Class: SC.Cookie
Extends
SC.Object.
Allows for easier handling of the document.cookie object. To create a cookie,
simply call SC.Cookie.create.
To retrieve a cookie, use SC.Cookie.find.
Cookies are not added to document.cookie, which SC.Cookie.find
uses, until you
have called SC.Cookie
#write.
Heavy inspiration from the {@link jQuery cookie plugin}.
Defined in: cookie.js
- Since:
- Sproutcore 1.0
Field Summary
- Fields borrowed from SC.Object:
- concatenatedProperties, isDestroyed, isObject, nextProperty, object, property, target, toInvalidate
- Fields borrowed from SC.Observable:
- isObservable
Class Methods
Instance Methods
Field Detail
domain String- Default value:
- null
Amount of time until the cookie expires. Set to -1 in order to delete the cookie.
If passing an Integer, it is interpreted as a number of days.
- Default value:
- null
- Default value:
- YES
- Default value:
- null
If true, the secure attribute of the cookie will be set and the cookie transmission will require a secure protocol (like HTTPS).
- Default value:
- NO
- Default value:
- ''
Class Method Detail
- Parameters:
- name String
- The name of the cookie
- Returns:
- SC.Cookie object containing name and value of cookie
Instance Method Detail
Writes this SC.Cookie
to document.cookie and adds it to SC.Cookie
collection. To find this
cookie later, or on reload, use SC.Cookie.find.
- See:
- SC.Cookie.find