public class NanoHTTPD.CookieHandler
extends java.lang.Object
implements java.lang.Iterable<java.lang.String>
Constructor and Description |
---|
CookieHandler(java.util.Map<java.lang.String,java.lang.String> httpHeaders) |
Modifier and Type | Method and Description |
---|---|
void |
delete(java.lang.String name)
Set a cookie with an expiration date from a month ago, effectively
deleting it on the client side.
|
java.util.Iterator<java.lang.String> |
iterator() |
java.lang.String |
read(java.lang.String name)
Read a cookie from the HTTP Headers.
|
void |
set(NanoHTTPD.Cookie cookie) |
void |
set(java.lang.String name,
java.lang.String value,
int expires)
Sets a cookie.
|
void |
unloadQueue(NanoHTTPD.Response response)
Internally used by the webserver to add all queued cookies into the
Response's HTTP Headers.
|
public CookieHandler(java.util.Map<java.lang.String,java.lang.String> httpHeaders)
public java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
public java.lang.String read(java.lang.String name)
name
- The cookie's name.public void set(java.lang.String name, java.lang.String value, int expires)
name
- The cookie's name.value
- The cookie's value.expires
- How many days until the cookie expires.public void set(NanoHTTPD.Cookie cookie)
public void delete(java.lang.String name)
name
- The cookie name.public void unloadQueue(NanoHTTPD.Response response)
response
- The Response object to which headers the queued cookies
will be added.