When a user opens his web browser and makes a request to a ASP.NET Web Application for which a cookie based Session is enabled, Server generates a new SessionId and sends it to web Browser as a cookie with the name "ASP.NET_SessionId". Applications in the same DNS domain share the same Session Id and cookie. When the user browses within the same DNS domain, the browser sends same Session Id and cookie to the domain. Since it is shared across applications in a domain, so ASP.NET doesn't remove the cookie when the session is expired or Session.Abandon() is invoked. Because of this design, the code that is used to check if a Server Session is actually expired doesn't work properly. Generally we use following code snippet to check if session is expired.
if (Session.IsNewSession) { if (Request.Headers("Cookie") != null && Request.Headers("Cookie").IndexOf("ASP.NET_SessionId") >= 0) { return true; } } return false;As ASP.NET doesn't remove the cookie "ASP.NET_SessionId" when the session is expired, so the above code doesn't check correctly. To ensure the above code works properly, the developer has to manually remove the session cookie in the event of a Session Expiry by using the following code.
Session.Abandon(); Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId") { Expires = DateTime.Now.AddDays(-1d) });
Good..... But i need to new session Id when browser is closed.
ReplyDeleteIt is really a great work and the way in which u r sharing the knowledge is excellent.
ReplyDeleteThanks for helping me to understand basic concepts. As a beginner in Dot Net programming your post help me a lot.Thanks for your informative article.
dot net training institute in velachery | top10 dot net training institutes in chennai
Applications in the same DNS domain share the same Session Id and cookie. When the user browses within the same DNS domain, the browser sends same Session Id and cookie to the domain. Dot Net Training in chennai | Dot Net Training in velachery
ReplyDeleteThanks for posting useful information.You have provided a nice article, Thank you very much for this one. And I hope this will be useful for many people..
ReplyDeleteAWS Training in HRBR Layout
AWS Training in Kalyan Nagar
Best AWS Training Institute in kalyan Nagar Bangalore
Useful information.I am actual blessed to read this article.thanks for giving us this advantageous information.I acknowledge this post.and I would like bookmark this post.Thanks
ReplyDeletedigital marketing training in marathahalli
digital marketing training in rajajinagar
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
ReplyDeletefull stack developer training in annanagar
full stack developer training in tambaram
full stack developer training in velachery
This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
ReplyDeletepython training institute in chennai
python training in Bangalore
python training in pune
Excellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
ReplyDeleteBlueprism training in tambaram
Blueprism training in annanagar
Blueprism training in velachery
I always enjoy reading quality articles by an individual who is obviously knowledgeable on their chosen subject. Ill be watching this post with much interest. Keep up the great work, I will be back
ReplyDeleteData science training in tambaram
Data Science training in anna nagar
Data Science training in chennai
Data science training in Bangalore
Data Science training in marathahalli
Data Science training in btm
I would really like to read some personal experiences like the way, you've explained through the above article. I'm glad for your achievements and would probably like to see much more in the near future. Thanks for share.
ReplyDeletejava training in omr | oracle training in chennai
java training in annanagar | java training in chennai
I love the blog. Great post. It is very true, people must learn how to learn before they can learn. lol i know it sounds funny but its very true. . .
ReplyDeleteangularjs Training in bangalore
angularjs Training in btm
angularjs Training in electronic-city
angularjs online Training
angularjs Training in marathahalli
Excellant post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
ReplyDeleteSelenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training
Keep up the good work; I read few posts on this website, including I consider that your blog is fascinating and has sets of the fantastic piece of information.
ReplyDeleteDot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery
Great post with awesome piece of information. I'm glad that I came across your post. Regards.. oracle training in chennai
ReplyDeletecareer towards a sky-high with Infycle Technologies. Infycle Technologies provides the top Oracle DBA Training in Chennai and offering programs in Oracle such as Oracle PL/SQL, Oracle Programming, etc., in the 200% hands-on practical training with professional specialists in the field. In addition to that, the interviews will be arranged for the candidates to set their careers without any struggle. Of all that, Cen percent placement assurance will be given here. To have
ReplyDeleteLearn Oracle DBA for making the best job for your life, call 7502633633 to Infycle Technologies and grab a free demo to know more.
No.1 Oracle DBA Training in Chennai | Infycle Technologies
This post is so interactive and informative.keep update more information…
ReplyDeleteAWS Training in Anna Nagar
AWS Training in Chennai
Mindblowing blog very useful thanks
ReplyDeleteArtificial Intelligence Course in porur
Artificial Intelligence Course in Chennai