แก้ไข

แชร์ผ่าน


CookieHandler.Delete Method

Definition

Deletes a cookie.

Overloads

Delete()

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

Delete(String)

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

Delete(HttpContext)

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

Delete(String, HttpContext)

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

Delete(String, String, String, HttpContext)

Deletes the cookie associated with the specified request that has the specified name, path, and domain.

Delete()

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

public:
 void Delete();
public void Delete ();
member this.Delete : unit -> unit
Public Sub Delete ()

Remarks

The name, domain and path are specified by the Name, Domain, and Path properties. The request is specified by HttpContext.Current

Applies to

Delete(String)

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

public:
 void Delete(System::String ^ name);
public void Delete (string name);
member this.Delete : string -> unit
Public Sub Delete (name As String)

Parameters

name
String

The name of the cookie.

Exceptions

name is null or empty.

Remarks

The domain and path are specified by the Domain and Path properties. The request is specified by HttpContext.Current

Applies to

Delete(HttpContext)

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

public:
 void Delete(System::Web::HttpContext ^ context);
public void Delete (System.Web.HttpContext context);
member this.Delete : System.Web.HttpContext -> unit
Public Sub Delete (context As HttpContext)

Parameters

context
HttpContext

The HttpContext for the request.

Remarks

The name, domain and path are specified by the Name, Domain, and Path properties.

Applies to

Delete(String, HttpContext)

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

public:
 void Delete(System::String ^ name, System::Web::HttpContext ^ context);
public void Delete (string name, System.Web.HttpContext context);
member this.Delete : string * System.Web.HttpContext -> unit
Public Sub Delete (name As String, context As HttpContext)

Parameters

name
String

The name of the cookie.

context
HttpContext

The HttpContext for the request.

Exceptions

name is null or empty.

Remarks

The domain and path are specified by the Domain and Path properties.

Applies to

Delete(String, String, String, HttpContext)

Deletes the cookie associated with the specified request that has the specified name, path, and domain.

public:
 void Delete(System::String ^ name, System::String ^ path, System::String ^ domain, System::Web::HttpContext ^ context);
public void Delete (string name, string path, string domain, System.Web.HttpContext context);
member this.Delete : string * string * string * System.Web.HttpContext -> unit
Public Sub Delete (name As String, path As String, domain As String, context As HttpContext)

Parameters

name
String

The name of the cookie.

path
String

The path for the cookie.

domain
String

The domain for the cookie.

context
HttpContext

The HttpContext for the request.

Exceptions

name is null or empty.

Applies to