Deletes, gets, sets cookie data.
Type
- engine
Property Summary
Event Summary
Method Summary
- delCookie( sName )
- Deletes data from the cookie.
- getCookie( sName )
- Gets data from the cookie.
- setCookie( sName , sValue , SameSite )
- Sets data in the cookie.
- setCookieAsync( sName , sValue , SameSite )
- Asynchronously sets data in the cookie.
Property Detail
Event Detail
Method Detail
- delCookie( sName )
-
Deletes cookie data.
Parameter name type required description sName String Y cookie name SampleWebSquare.cookie.delCookie("globalDebug"); - getCookie( sName )
-
Gets data from the cookie.
Parameter name type required description sName String Y cookie name Return type description String cookie value SampleWebSquare.cookie.getCookie("globalDebug"); - setCookie( sName , sValue , SameSite )
-
Sets data in the cookie.
The newly set data will be deleted upon browser termination. (Session Cookie)Parameter name type required description sName String Y cookie name sValue String Y cookie value SameSite String N SameSite option (None, Lax, Strict) SampleWebSquare.cookie.setCookie("globalDebug", "false"); // SameSite 'Lax' WebSquare.cookie.setCookie("globalDebug", "false", "None"); WebSquare.cookie.setCookie("globalDebug", "false", "Strict"); (SameSite Options) "None" : Send cookies both to the same site and the cross site. "Lax" : Apply some exceptions to the Strct setting. (HTTP get method / a href / link href) "Strict" : In case of different domains, cookies cannot be sent. - setCookieAsync( sName , sValue , SameSite )
-
Asynchronously sets data in the cookie.
The newly set data will be deleted upon browser termination.
Blinking occurs upon the cookie being accessed asynchronously on IE. In this case, setCookieAsync is recommended.Parameter name type required description sName String Y cookie name sValue String Y cookie value SameSite String N SameSite option (None, Lax, Strict) SampleWebSquare.cookie.setCookieAsync("globalDebug", "false"); WebSquare.cookie.setCookie("globalDebug", "false", "None"); WebSquare.cookie.setCookie("globalDebug", "false", "Strict"); (SameSite Options) "None" : Send cookies both to the same site and the cross site. "Lax" : Apply some exceptions to the Strct setting. (HTTP get method / a href / link href) "Strict" : In case of different domains, cookies cannot be sent.