API Documentation for: 1.1.2
Show:

Canteen.SavedData Class

Namespace: Canteen

Utility class for saving data to JavaScript cookies

Item Index

Methods

Properties

Methods

clear

(
  • name
)
static

Clear a cookie value by name

Parameters:

  • name String

    The name of the cooie property

read

(
  • name
)
Mixed static

Read the value of the cookie

Parameters:

  • name String

    The name of the cookie

Returns:

Mixed:

The value or null if it doesn't exist

write

(
  • name
  • value
  • days
)
static

Create a cookie variable

Parameters:

  • name String

    The name of the cookie to create

  • value Mixed

    The value to save

  • days Int

    The number of days to keep - omit this to have the data cleared when the browser is closed

Properties

NEVER_EXPIRE

String final static

Use this value in place of 'days' to save data that expires when the Date object no longer functions (more than 270 thousand years from now)

Default: neverExpire