Вы находитесь на странице: 1из 2

Ext.util.Cookies - Ext JS 3.

4 - Sencha Docs

http://docs.sencha.com/ext-js/3-4/?print=/api/Ext.util.Cookies

Ext JS 3.4 Sencha Docs

Utility class for managing and interacting with cookies. Available since: Ext 3

FILES

Cookies.js

Methods
clear( name ) Removes a cookie with the provided name from the browser if found by setting its expiration date to sometime in the past. Available since: Ext 3

Defined By
Ext.util.Cookies

Parameters
name : String

The name of the cookie to remove

get( name ) : Mixed Ext.util.Cookies Retrieves cookies that are accessible by the current page. If a cookie does not exist, get() returns null. The following example retrieves the cookie called "valid" and stores the String value in the variable validStatus. var validStatus = Ext.util.Cookies.get("valid"); Available since: Ext 3

Parameters
name : String

The name of the cookie to get

Returns
Mixed

Returns the cookie value for the specified name; null if the cookie name does not exist.

getCookieVal( offset ) Available since: Ext 3

PRIVATE

Ext.util.Cookies

Parameters
offset : Object

set( name, value, [expires], [path], [domain], [secure] ) Create a cookie with the specified name and value. Additional settings for the cookie may be

Ext.util.Cookies

1 of 2

01/10/2012 07:56 PM

Ext.util.Cookies - Ext JS 3.4 - Sencha Docs

http://docs.sencha.com/ext-js/3-4/?print=/api/Ext.util.Cookies

optionally specified (for example: expiration, access restriction, SSL). Available since: Ext 3

Parameters
name : String

The name of the cookie to set.


value : Mixed

The value to set for the cookie.


expires : Object (optional)

Specify an expiration date the cookie is to persist until. Note that the specified Date object will be converted to Greenwich Mean Time (GMT).
path : String (optional)

Setting a path on the cookie restricts access to pages that match that path. Defaults to all pages ('/').
domain : String (optional)

Setting a domain restricts access to pages on a given domain (typically used to allow cookie access across subdomains). For example, "extjs.com" will create a cookie that can be accessed from any subdomain of extjs.com, including www.extjs.com, support.extjs.com, etc.
secure : Boolean (optional)

Specify true to indicate that the cookie should only be accessible via SSL on a page using the HTTPS protocol. Defaults to false. Note that this will only work if the page calling this code uses the HTTPS protocol, otherwise the cookie will be created with default options.

2 of 2

01/10/2012 07:56 PM

Вам также может понравиться