Click here to Skip to main content
15,913,722 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi.

I am working on asp.new web forms c# project. i have problem with the session after several refreshes on the page the session disappear. what can be the problem?

thanks
Posted
Comments
Are you redirecting after setting Session?
thekoko89 8-Jun-13 13:52pm    
its just simple login i create the session and then redirect. But i dont lose it there. After a few not exactly number of refreshes in part of the site where you need to be logged to can get in i lose my session.
Refer - Session Variables value lost on page refresh . One of the answers says...

"You could handle the Session_End event in Global.asax, and throw an exception for the event (it might give some hint to when it's disappearing)..."

Do it and check.
Ahmed Bensaid 10-Jun-13 3:36am    
Hello,
Maybe there is a problem with your session expiration time-out...

1 solution

1) you can check in master page/deafult page that if any session values is lost then redirect to home Page

2)check if any session value is lost in Page load itself

3)You can use following options:

Copy Code make a dummy webform,pass Session variable in querystring :to check...

use ViewState variable, if required!

use Request.Forms variable

4)Solve cookies,Session time-out prbms if any
5)Do thorough testing and see if their is any mistake in logic itself
 
Share this answer
 
Comments
thekoko89 10-Jun-13 8:52am    
Tnx.. I will try all of this 1st will test the timeout, then if still have the same problem then i will try the rest and will tell you what happend :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900