Click here to Skip to main content
13,094,983 members (83,370 online)
Rate this:
Please Sign up or sign in to vote.
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 2-Jul-12 5:26am
A_K_ 2-Jul-12 11:34am
I think you forgot to ask the actual question..
XzRaider27 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.
ryanb31 2-Jul-12 12:57pm
If you are calling a webservice make sure you add [WebMethod(EnableSession = true)] to your function.
XzRaider27 5-Jul-12 11:12am
thanks this fix my problem!
ryanb31 5-Jul-12 11:31am
Good to hear.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

to your function.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 5 Jul 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100