SAPO::Utility.Cookie->set
This method will sets a cookie with defined params
This is static method.
Syntax
SAPO.Utility.Cookie.set(<string>, <string>, <number>, [<string>], [<string>], [boolean])
Compatibility
| All browsers | Yes |
Depends
Input Parameters
- (string) string : Cookie name
- (string) string : Cookie value
- (number) number : lifetime (in seconds)
- (string) string : (Optional) Path (default is '/')
- (string) string : (Optional) Domain (default is current host)
- (boolean) true or false : (Optional) Secure (default is false)
Sample
http://js.sapo.pt/SAPO/Utility/Cookie/sample/
Example
SAPO.Utility.Cookie.set('id', 'id_123', 3600, '/', 'sub.domain.com', false);
Community feedback