I have a website that I host from one of the hosting companies. It is mostly coded in asp, javascript, html. It is not yet live for users I am still in testing mode. The site was working fine and now I keep losing session. I log in and within a couple of clicks, I have lost the session. Can anyone please explain why that would happen? or how that happens? I have validation check on each page after login for a couple of session variables. Now with lost sessions, I have no idea how to validate a user from page to page. Is there any other way to do that other than using session variables? Frankly, I am stumped! Like I said previously, it was working fine and now I have no idea why it is doing this. I have talked to the hosting with no luck. If there is any way to get around using session varriables, I would be very happy at the moment. Please help me. This is my first web site and I volunteered myself for this community website. I would really appreciate all the help that I can get. Thanking all in advance.
Sessions time out by default after 20 minutes. Maybe you could try and set the time out for a longer period : <% Session.Timeout=40 %> or whatever number of minutes you may need. You need to add this to the page where the session is used. Alternatively, you could use cookies which are stored on your visitor's PC and set the delete cookie for the same day.
Thank you 50plus. The IIS server is set at 20 mins for timeout and this happens within a minute of logging in. Other than cookies, is there any other way? I don't want to force the members of the community to accept cookies.
Could any of the pages that you access within this minute have any code that sets the session to null or abandon by chance ? Instead of cookies you could put your session info in query strings like page.asp?id=abc&whatever=xyz but that makes for long urls showing info that maybe you don't want the user to see. Just an idea.
I have checked and I don't have session.abandon or session.contents.RemoveAll in any of the pages - only page to have that is the logout page