Class YAHOO.ext.state.CookieProvider
| Package: | YAHOO.ext.state |
| Class: | CookieProvider |
| Extends: | Provider |
| Defined In: | State.js |
The default Provider implementation. The example below includes all valid configuration options and their
default values.
var cp = new YAHOO.ext.state.CookieProvider({
path: '/',
expires: new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days
domain: null,
secure: false
})
YAHOO.ext.state.Manager.setProvider(cp);
Public Properties
This class has no public properties.
Public Methods
Public Events
| |
statechange : (Provider this, String key, String value) |
Provider |
| Fires when a state change occurs. |
Constructor Details
CookieProvider
public function CookieProvider(Object config)
Create a new CookieProvider
Parameters:
config : ObjectThe configuration object
Method Details
clear
public function clear()
Clear a value from the state.
decodeValue
public function decodeValue(String value)
encodeValue
public function encodeValue(Mixed value)
Encode a value including type information.
get
public function get(String name, Mixed defaultValue)
Get the current value for a key.
Parameters:
name : StringdefaultValue : Mixed
Returns:
set
public function set(String name, Mixed value)
Set the value for a key.
Parameters:
name : Stringvalue : Mixed
Returns:
Event Details
statechange
public event statechange
Fires when a state change occurs.
Subscribers will be called with the following parameters: