mrspoonzy at gmail Cube by Noah Ellman A powerful javascript toolkit, in research © by Noah Ellman

Jwee API > wee.cookie

wee.cookie get(...)
set(...)
unset(...)

The wee.cookie toolkit provides everything you need to read, write, and delete cookies dynamically from Javascript.

function wee.cookie.get(...)( string name )
Get a cookie.
Args
  1. {string} the cookie name
Returns{string} the cookie value, or undefined

var sessid = Cookie.get( "PHPSESSID" )

var input = Elem.create('input');
input.type = "hidden"
input.name = "PHPSESSID";
input.value = sessid;
function wee.cookie.set(...)( string name,  string value,  [string date] )
Set a cookie.
Args
  1. {string} the cookie name
  2. {string} the cookie's value
  3. optional (string) a value such as: "1 hour" or "5 days", for when the cookie should expire

Cookie.set( "rememberMe", "true", "2 weeks" );
function wee.cookie.unset(...)( string name )
Delete a cookie
Args
  1. (string) the cookie name

Discussion on /learn/api/wee-cookie




Smithc409 10/17/16 :  

A person essentially help to make seriously posts I would state. This is the first time I frequented your web page and thus far? I surprised with the research you made to create this particular publish extraordinary. Fantastic job! aeaedaeakkeaccbd


Xymon 11/05/14 :  

Hmm... Why are they called cookies? Do you know the relevance between an actual cookie and an HTTP cookie?


TheDoctor 11/05/14 :  

You might want to add more options to wee.cookie.set(). (secure,domain,path,etc.)


Xymon 11/05/14 :  

Yup, I haven't experimented any with it so I can't say it is bug-free. However, here it is: www.jwee.org/learn/api/wee-cookie


Admin 11/05/14 :  

Yes I squeezed it down - there is so much chat!