C# Class Ext.Net.Cookies

Inheritance: ScriptClass
Exibir arquivo Open project: pgodwin/Ext.net

Public Methods

Method Description
Clear ( string name ) : void

Removes a cookie with the provided name from the browser if found by setting its expiration date to sometime in the past.

GetCookie ( string name ) : System.Web.HttpCookie

Retrieves cookie that are accessible by the current page. If a cookie does not exist, get() returns null.

GetValue ( string name ) : string

Retrieves cookie value that are accessible by the current page. If a cookie does not exist, get() returns null.

Set ( string name, object value, System.DateTime expires, string path, string domain, bool secure ) : void

Create a cookie with the specified name and value. Additional settings for the cookie may be optionally specified (for example: expiration, access restriction, SSL).

ToScript ( ) : string

Protected Methods

Method Description
CallCookies ( string name ) : void

Method Details

CallCookies() protected method

protected CallCookies ( string name ) : void
name string
return void

Clear() public static method

Removes a cookie with the provided name from the browser if found by setting its expiration date to sometime in the past.
public static Clear ( string name ) : void
name string The name of the cookie to remove
return void

GetCookie() public static method

Retrieves cookie that are accessible by the current page. If a cookie does not exist, get() returns null.
public static GetCookie ( string name ) : System.Web.HttpCookie
name string The name of the cookie to get
return System.Web.HttpCookie

GetValue() public static method

Retrieves cookie value that are accessible by the current page. If a cookie does not exist, get() returns null.
public static GetValue ( string name ) : string
name string The name of the cookie to get
return string

Set() public static method

Create a cookie with the specified name and value. Additional settings for the cookie may be optionally specified (for example: expiration, access restriction, SSL).
public static Set ( string name, object value, System.DateTime expires, string path, string domain, bool secure ) : void
name string The name of the cookie to set.
value object The value to set for the cookie.
expires System.DateTime Specify an expiration date the cookie is to persist until. Note that the specified Date object will be converted to Greenwich Mean Time (GMT).
path string Setting a path on the cookie restricts access to pages that match that path. Defaults to all pages ('/').
domain string Setting a domain restricts access to pages on a given domain (typically used to allow cookie access across subdomains). For example, "ext.net" will create a cookie that can be accessed from any subdomain of ext.net, including www.ext.net, support.ext.net, etc.
secure bool Specify true to indicate that the cookie should only be accessible via SSL on a page using the HTTPS protocol. Defaults to false. Note that this will only work if the page calling this code uses the HTTPS protocol, otherwise the cookie will be created with default options.
return void

ToScript() public method

public ToScript ( ) : string
return string