470,596 Members | 1,204 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,596 developers. It's quick & easy.

how Server judge an Ajax Request belongs to a Session

24
When user is authenticated, the server store "UserName" in session. Then throug ajax, the user request another page which require authentication. How the ajax request tell the server that one has been authenticated, or how the server know it's from 'UserName"?

Should ajax set SessionId in Header or Cookie ? How to get and set the SessionId ?

I learned the browser could send back to server a sessionid, but I don't know how this should be done in JS.

I'm using JQuery, C#.
Feb 21 '08 #1
3 1872
acoder
16,027 Expert Mod 8TB
Post some code that we can have a look at. Have you tried setting the session id without Ajax and got it all working fine?
Feb 21 '08 #2
rnd me
427 Expert 256MB
When user is authenticated, the server store "UserName" in session. Then throug ajax, the user request another page which require authentication. How the ajax request tell the server that one has been authenticated, or how the server know it's from 'UserName"?

Should ajax set SessionId in Header or Cookie ? How to get and set the SessionId ?

I learned the browser could send back to server a sessionid, but I don't know how this should be done in JS.

I'm using JQuery, C#.

my ajax code usually (in firefox at least) will automatically pop-up a login box if needed. the browser should handle this, it not something to worry about in js.

ajax will use the page's connection to the server.
when your page's connection times-out, so does the ajax auth.

does that help?
Feb 21 '08 #3
mentor
24
So I see that ajax will use the page's connection to the server. That's Ok, Thanks !


ajax will use the page's connection to the server.
when your page's connection times-out, so does the ajax auth.

does that help?
Mar 9 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post: by
16 posts views Thread by deostroll | last post: by
4 posts views Thread by KDawg44 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.