Node Director
Public Member Functions | List of all members
fi.iki.elonen.NanoHTTPD.CookieHandler Class Reference

Provides rudimentary support for cookies. More...

Public Member Functions

 CookieHandler (Map< String, String > httpHeaders)
void delete (String name)
 Set a cookie with an expiration date from a month ago, effectively deleting it on the client side.
Iterator< String > iterator ()
String read (String name)
 Read a cookie from the HTTP Headers.
void set (Cookie cookie)
void set (String name, String value, int expires)
 Sets a cookie.
void unloadQueue (Response response)
 Internally used by the webserver to add all queued cookies into the Response's HTTP Headers.

Detailed Description

Provides rudimentary support for cookies.

Doesn't support 'path', 'secure' nor 'httpOnly'. Feel free to improve it and/or add unsupported features.

Author
LordFokas

Constructor & Destructor Documentation

fi.iki.elonen.NanoHTTPD.CookieHandler.CookieHandler ( Map< String, String >  httpHeaders)

Member Function Documentation

void fi.iki.elonen.NanoHTTPD.CookieHandler.delete ( String  name)

Set a cookie with an expiration date from a month ago, effectively deleting it on the client side.

Parameters
nameThe cookie name.
Iterator<String> fi.iki.elonen.NanoHTTPD.CookieHandler.iterator ( )
String fi.iki.elonen.NanoHTTPD.CookieHandler.read ( String  name)

Read a cookie from the HTTP Headers.

Parameters
nameThe cookie's name.
Returns
The cookie's value if it exists, null otherwise.
void fi.iki.elonen.NanoHTTPD.CookieHandler.set ( Cookie  cookie)
void fi.iki.elonen.NanoHTTPD.CookieHandler.set ( String  name,
String  value,
int  expires 
)

Sets a cookie.

Parameters
nameThe cookie's name.
valueThe cookie's value.
expiresHow many days until the cookie expires.
void fi.iki.elonen.NanoHTTPD.CookieHandler.unloadQueue ( Response  response)

Internally used by the webserver to add all queued cookies into the Response's HTTP Headers.

Parameters
responseThe Response object to which headers the queued cookies will be added.

Referenced by fi.iki.elonen.NanoHTTPD.HTTPSession.execute().


The documentation for this class was generated from the following file: