Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If Im correct this means that the session has timeout? But in web.config is set to 30 minutes and the differences between the time its created and called again is about a minutes.

First I thought it was because I was using a generic handler. But now Im making the call to a web form and it does the same. Think it has to do with making the request from ajax.

Any suggestions will be appreciated.
Posted
Comments
_Amy 2-Jul-12 11:34am    
I think you forgot to ask the actual question..
Zumicts 2-Jul-12 11:38am    
Oh sorry if I wasn't that clear bud. What is the cause of the session timing out every time I made a request from ajax?
sjelen 2-Jul-12 12:55pm    
There are many reasons for this, hard to tell without more details and code.
Check if session id header is sent along with AJAX request (use Fiddler or Firebug). If you're using 'Cookieless' sessions, you'll need to manually append session id to query string of your AJAX request.
When using generic handlers you'll need to implement IRequiresSessionState interface on it.
ZurdoDev 2-Jul-12 12:57pm    
If you are calling a webservice make sure you add [WebMethod(EnableSession = true)] to your function.
Zumicts 5-Jul-12 11:12am    
thanks this fix my problem!

1 solution

If you are calling a webservice make sure you add
C#
[WebMethod(EnableSession = true)]

to your function.
 
Share this answer
 

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