TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Pothi Sam
NA
335
50.3k
How to Delete particular cookie in asp.net C#
Jan 7 2015 4:21 AM
my logout code are
protected void Page_Load(object sender, EventArgs e)
{
//if (Request.Cookies["Prno"] != null)
//{
// HttpCookie myCookie = new HttpCookie("Prno");
// myCookie.Value = String.Empty;
// myCookie.Expires = DateTime.Now.AddYears(-1);
// Response.Cookies.Add(myCookie);
// Response.Cookies.Remove("Prno");
//}
HttpCookie myCookie = new HttpCookie("Prno");
//Here, we are setting the time to a previous time.
//When the browser detect it next time, it will be deleted automatically.
myCookie.Expires = DateTime.Now.AddDays(-1d);
Response.Cookies.Add(myCookie);
//Request.Cookies["Prno"].Expires = DateTime.Now;
Session.Abandon();
Session.Clear();
Response.Cookies.Clear();
Response.Redirect("~/Login.aspx");
}
}
Reply
Answers (
2
)
list tool in rdlc report
Remove underline & Cell Border