How to delete all the cookies of the project after session timeout? and it will also reflect in browser window.
Loading
How to delete all the cookies of the project after session timeout? and it will also reflect in browser window.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh KumarPosted Apr 3, 2023, 2:15 PM
Hello Brahma prakash,
You can do this in the session_end event by adding the code below.
Ali BenchaabanPosted Apr 3, 2023, 10:24 AM
Try this
Amit MohantyPosted Apr 3, 2023, 10:14 AM
Try this
Brahma Prakash ShuklaPosted Apr 3, 2023, 10:00 AM
It is not working as session ends is not taking cookies using HttpContext.Current.Request.Cookies.To avoid it we need to set cookies on the start of session .
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
// Store a reference to the HttpContext object in the session
Session["HttpContext"] = HttpContext.Current;
}
But this way it id not taking cookies which were applied on page load of any other page.
Ali BenchaabanPosted Apr 3, 2023, 9:54 AM
yes, it should work with Session_End method.
keep us informed if it works or not, thank you
Brahma Prakash ShuklaPosted Apr 3, 2023, 9:32 AM
I want to apply this on global.asax file on session end method, it will work or not ?
Ali BenchaabanPosted Apr 3, 2023, 9:18 AM
Hello Brahma Prakash Shukla,
Try this method
BENCHAABAN Ali