Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WebForms
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
Zumicts521
Comments
A_K_ at 2-Jul-12 11:34am
   
I think you forgot to ask the actual question..
XzRaider27 at 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 at 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 at 2-Jul-12 12:57pm
   
If you are calling a webservice make sure you add [WebMethod(EnableSession = true)] to your function.
XzRaider27 at 5-Jul-12 11:12am
   
thanks this fix my problem!
ryanb31 at 5-Jul-12 11:31am
   
Good to hear.

1 solution

Rate this: bad
good
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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 400
1 Gihan Liyanage 238
2 Sergey Alexandrovich Kryukov 150
3 ChauhanAjay 120
4 syed shanu 110
0 Sergey Alexandrovich Kryukov 9,021
1 OriginalGriff 7,941
2 CPallini 2,603
3 Richard MacCutchan 2,121
4 Abhinav S 1,928


Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 5 Jul 2012
Copyright © CodeProject, 1999-2014
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