Saved Bookmarks
| 1. |
How Can I Set A Cookie And Delete A Cookie From Within A Jsp Page? |
|
Answer» A cookie, mycookie, can be DELETED using the following scriptlet: <%//CREATING a cookieCookie mycookie = new Cookie("aName","aValue"); response.addCookie(mycookie); //DELETE a cookieCookie killMyCookie = new Cookie("mycookie", NULL); killMyCookie.setMaxAge(0);killMyCookie.setPath("/"); response.addCookie(killMyCookie);%>A cookie, mycookie, can be deleted using the following scriptlet: |
|