Cookies
Assembly: ServiceStack.dll
View Source
Declaration
public class Cookies : ICookies
Properties
Collection
View Source
Declaration
public List<Cookie> Collection { get; set; }
Fields
RootPath
View Source
Declaration
public const string RootPath = "/"
Methods
AddPermanentCookie(String, String, Nullable<Boolean>)
Sets a persistent cookie which never expires
View Source
Declaration
public void AddPermanentCookie(string cookieName, string cookieValue, bool? secureOnly = null)
Parameters
Type | Name |
---|---|
System.String | cookieName |
System.String | cookieValue |
System.Nullable<System.Boolean> | secureOnly |
AddSessionCookie(String, String, Nullable<Boolean>)
Sets a session cookie which expires after the browser session closes
View Source
Declaration
public void AddSessionCookie(string cookieName, string cookieValue, bool? secureOnly = null)
Parameters
Type | Name |
---|---|
System.String | cookieName |
System.String | cookieValue |
System.Nullable<System.Boolean> | secureOnly |
DeleteCookie(String)
Deletes a specified cookie by setting its value to empty and expiration to -1 days
View Source
Declaration
public void DeleteCookie(string cookieName)
Parameters
Type | Name |
---|---|
System.String | cookieName |