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
Phani Kumar
NA
162
24.8k
how to clear browser cookies for user credentials
Jun 10 2020 8:25 AM
Hi Team,
I have a requirement, user can login to website from any browser and clikced on remember me after performing his/her work, user will logout, once logged out cookies should be cleared automatically, I have tried by adding below code.
Session.Clear();
Session.Abandon();
HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
HttpContext.Current.Response.Cache.SetValidUntilExpires(false);
HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetNoStore();
HttpContext.Current.Response.Cookies.Clear();
HttpContext.Current.Request.Cookies.Clear();
FormsAuthentication.SignOut();
Response.Clear();
FormsAuthentication.RedirectToLoginPage("loginpageurl");
This code was added in my logout page and tried it, but it couldn't worked
Can anyone help me out on this.
Thanks in advance for help
Regards
Phani Kumar
Reply
Answers (
2
)
How to open and display .eml file in ASP .NET C# in new tab
Things to be considered for a large scale SAAS products