CookieHandler.Read Method

Definition

Reads a cookie.

Overloads

Read()

Reads the cookie associated with the current request that has the default name.

Read(String)

Reads the cookie associated with the current request that has the specified name.

Read(HttpContext)

Reads the cookie associated with the current request that has the default name, domain, and path.

Read(String, HttpContext)

Reads the cookie associated with the specified request that has the specified name and the default domain and path.

Read()

Reads the cookie associated with the current request that has the default name.

public:
 cli::array <System::Byte> ^ Read();
public byte[] Read ();
member this.Read : unit -> byte[]
Public Function Read () As Byte()

Returns

Byte[]

The cookie value or null if the cookie was not found.

Remarks

The name of the cookie is specified by the Name property. The request is specified by HttpContext.Current.

Applies to

Read(String)

Reads the cookie associated with the current request that has the specified name.

public:
 cli::array <System::Byte> ^ Read(System::String ^ name);
public byte[] Read (string name);
member this.Read : string -> byte[]
Public Function Read (name As String) As Byte()

Parameters

name
String

The name of the cookie to read.

Returns

Byte[]

The cookie value or null if the cookie was not found.

Exceptions

name is null or empty.

Remarks

The request is specified by HttpContext.Current

Applies to

Read(HttpContext)

Reads the cookie associated with the current request that has the default name, domain, and path.

public:
 cli::array <System::Byte> ^ Read(System::Web::HttpContext ^ context);
public byte[] Read (System.Web.HttpContext context);
member this.Read : System.Web.HttpContext -> byte[]
Public Function Read (context As HttpContext) As Byte()

Parameters

context
HttpContext

The HttpContext for the request.

Returns

Byte[]

The cookie value or null if the cookie was not found.

Remarks

The name of the cookie is specified by the Name property.

Applies to

Read(String, HttpContext)

Reads the cookie associated with the specified request that has the specified name and the default domain and path.

public:
 cli::array <System::Byte> ^ Read(System::String ^ name, System::Web::HttpContext ^ context);
public byte[] Read (string name, System.Web.HttpContext context);
member this.Read : string * System.Web.HttpContext -> byte[]
Public Function Read (name As String, context As HttpContext) As Byte()

Parameters

name
String

The name of the cookie to read.

context
HttpContext

The HttpContext for the request.

Returns

Byte[]

The cookie value or null if the cookie was not found.

Exceptions

name is null or empty.

Applies to