Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Session state lost between ajax posts?

Tags:

asp.net

I have an asp.net login page, which when initialized sets some session variables. When the user clicks login, an AJAX request is made which validates the user and sets additional session variables and returns a result to the client. The client is then redirected based on the login result. In the redirected page, I can access the session variables set when the login page was initialized (i.e. before the login) but none are present for those set during the login validation (part of an ajax call).

is this expected behaviour? Why would an ajax call generate a new session and thus cause the data to be lost?

Thanks

like image 870
LDJ Avatar asked Oct 26 '22 10:10

LDJ


1 Answers

Is the location for your ajax call in the same application space as the rest of the application?? If I remember right you can't share session information between applications. That may be what's going on.

like image 179
mwgriffith Avatar answered Nov 27 '22 09:11

mwgriffith