SessionID changes after each post back or each refresh of page.
if you have problem of changing sessionID (Session.SessionID) on each post back or refresh.
you can add Global.asax file In your Application.
Once i Got this problem.i dont know why this happning. But i found Solution
by help of my friend.
you can Add Global.asax in your application folder
OR
You can Declare dummy session in Your Page Load event handler.
eg.
Session["Dummy"]="";
if you find and other solution or reason for this problem please leave
a comment.
Thanks.
A blog where you can find tutorials on ASP.Net, Ajax Control Toolkit, SQL Server 2008/2005, WCF, WPF, Silverlight, Azure and other Microsoft Technologies
Wednesday, April 22, 2009
3 comments:
Comments posted on ASP.Net Ajax Tutorials Blog are moderated and will be approved only if they are on-topic and not abusive. Please email me or my team for tech-support or blogging related questions. Avoid including website URLs in your comments - Thanks Author
Subscribe to:
Post Comments (Atom)
Thanks, this helped my problem!
ReplyDeleteYou will find this problem/issue only in ASP.NET 2.0 or later versions. The reason is:
ReplyDelete"When using cookie-based session state, ASP.NET does not allocate storage for session data until the Session object is used. As a result, a new session ID is generated for each page request until the session object is accessed. If your application requires a static session ID for the entire session, you can either implement the Session_Start method in the application's Global.asax file and store data in the Session object to fix the session ID, or you can use code in another part of your application to explicitly store data in the Session object."
i implement visitors count functionality in my web site. I used Session_Start() in Global file.
ReplyDeleteCount gets incremented each time that page refreshes.
Whats soln for that.