Surya sasidhar
Surya sasidhar

Reputation: 30313

Cookies in asp.net [inmemory cookie, persistent cookie]

How can I delete the cookie in persistent cookie not abandon()?

Upvotes: 1

Views: 635

Answers (2)

Paul
Paul

Reputation: 5576

Just make it expire:

Response.Cookies["cookiename"].Expires = DateTime.Now;

Upvotes: 4

cjk
cjk

Reputation: 46425

Just send a new cookie with the same name and an expiry in the past, or if you want it to change from persistent to session only, send a new cookie with the same name and no expiry.

Upvotes: 0

Related Questions