Name

Class xbCookies — provide access to the document's cookies

Synopsis

extends Class xbObject

class xbCookies : xbObject
{
  // constructor
  xbCookies();
    
  // methods
  void setExpires(Date date);
  void setPath(String path);
  void setDomain(String domain);
  void setSecure();
  void save();
    
  // properties
  Object value;
}    
		

Example

var cookies = new xbCookies();

if (!cookies.value['ID'])
{
	cookies.value['ID'] = makeId(); 
	cookies.value['VISITS'] = 0;
	cookies.setExpires( "12/31/2100" );
	cookies.setPath('/path');
}

cookies.value['VISITS'] = parseInt(cookies.value['VISITS']) + 1;
cookies.save();	
		

Source

xbCookies.js

Description

Constructs an instance of the xbCookies class from the document.cookies string.

Properties

value

readonly Object - hash containing cookie values.

Methods

xbCookies()

Constructs an instance of the xbCookies class.

Returns. Nothing

Exceptions

  • None

setExpires(Date date)

sets cookie expiration date

Returns.  Nothing

Exceptions

  • None

setPath(String path)

sets a cookie's path.

Returns.  Nothing

Exceptions

  • None

setDomain(String domain)

sets a cookie's domain.

Returns.  Nothing

Exceptions

  • None

setSecure()

sets cookie to secure.

Returns.  Nothing

Exceptions

  • Nothing

save()

saves cookies to user's machine.

Returns.  Nothing

Exceptions

  • None