util/ Cookie.js

Simple functions to get and set cookie information

Copyright

2004 Rob Rohan robr.nosp@m.ohan@gmai.nosp@m.l.com All rights reserved

Summary
Simple functions to get and set cookie information
the library version
gets a value from the current cookie
sets a value in a cookie
Removes a cookie (sets the expires to the past really)
sets a cookie that will last 20 years
Sets the preformatted string to the cookie

Variables

COOKIE_VERSION

var COOKIE_VERSION

the library version

Functions

getCookie

function getCookie(name)

gets a value from the current cookie

Parameters

namethe name of the key in the cookie

Returns

the cookies value

setCookie

function setCookie(name,
value,
expires,
path,
domain,
secure)

sets a value in a cookie

Parameters

namethe name
valuethe value
expires(optional) date of expires
path(optional)
domain(optional)
secure(optional)

removeCookie

function removeCookie(name,
path,
domain,
secure)

Removes a cookie (sets the expires to the past really)

Parameters

namethe name
path(optional)
domain(optional)
secure(optional)

setPermCookie

function setPermCookie(name,
value,
path,
domain,
secure)

sets a cookie that will last 20 years

Parameters

namethe name
valuethe value of the cookie
path(optional)
domain(optional)
secure(optional)

setRawCookie

function setRawCookie(cookie)

Sets the preformatted string to the cookie

Parameters

cookiethe raw cookie string
var COOKIE_VERSION
the library version
function getCookie(name)
gets a value from the current cookie
function setCookie(name,
value,
expires,
path,
domain,
secure)
sets a value in a cookie
function removeCookie(name,
path,
domain,
secure)
Removes a cookie (sets the expires to the past really)
function setPermCookie(name,
value,
path,
domain,
secure)
sets a cookie that will last 20 years
function setRawCookie(cookie)
Sets the preformatted string to the cookie