CookieHelper..::..StoreInCookie Method (HttpContext, String, String, String, String, String, Nullable<(Of <(<'DateTime>)>)>, Nullable<(Of <(<'Boolean>)>)>, SameSiteMode, Boolean)
Stores a value in a user Cookie, creating it if it doesn't exists yet.
Namespace:
AdvantageCMS.Core.UtilsAssembly: AdvantageCMS.Core (in AdvantageCMS.Core.dll)
Syntax
Parameters
- context
- Type: HttpContext
The context.
- cookieName
- Type: String
Cookie name
- keyName
- Type: String
Cookie key name (if the cookie is a keyvalue pair): if NULL or EMPTY, the cookie will be treated as a single variable.
- value
- Type: String
Value to store into the cookie
- cookieDomain
- Type: String
Cookie domain (or NULL to use default domain value)
- cookiePath
- Type: String
The cookie path.
- expirationDate
- Type: Nullable<(Of <(<'DateTime>)>)>
Expiration Date (set it to NULL to leave default expiration date)
- httpOnly
- Type: Nullable<(Of <(<'Boolean>)>)>
set it to TRUE to enable HttpOnly, FALSE otherwise (default: false)
- sameSite
- Type: SameSiteMode
set it to 'None', 'Lax', 'Strict' or '(-1)' to not add it (default: '(-1)').
- secure
- Type: Boolean
set it to TRUE to enable Secure (HTTPS only), FALSE otherwise