SE452: Cookie API [4/16] ![]() ![]() ![]() |
public Cookie(java.lang.String name, java.lang.String value)
Creates a Cookie
public void setMaxAge(int expiry)
Set to age in seconds when Cookie expires, 0 deletes it
negative value deletes it when browser exits
getters/setters for Name, Value, Path, Domain, etc.
Cookies are returned by the browser to the server if the Domain and Path match the server
Getting Cookies from the request
public Cookie[] getCookies()
Adding Cookies to the response
public void addCookie(Cookie cookie)