Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   ASP.NET 2.0 session cookie lost if global.asax is not present (http://www.velocityreviews.com/forums/t153323-asp-net-2-0-session-cookie-lost-if-global-asax-is-not-present.html)

=?Utf-8?B?QnJpYW4gV2FsdGVycw==?= 04-25-2006 02:30 AM

ASP.NET 2.0 session cookie lost if global.asax is not present
 
I just wanted to post this after looking in google and not finding anything
about it:


If you create an asp.net 2.0 project, you will find that it does not save
the session cookie unless you add a global.asax file to the project (in 2.0
there is not one by default).

More specifically, you must handle the Session_Start event in order for
sessions to be persisted. I checked this by creating a page with two
controls: a text box and a button. The Page_Load for the page has
"TextBox1.Text = Session.SessionID;" in it. You will notice a different
session id is generated each time you click the button. This behavior is not
expected. The SessionID should be the same for each postback.

The behavior stops if you add a Global.asax file to the project.


ddrib 02-26-2008 02:58 AM

Problem Solved...
 
You were right as soon as I created a global.asax in my project bang! Session works straight away. Thanks for the tip.


All times are GMT. The time now is 03:54 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.