472,986 Members | 3,164 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,986 software developers and data experts.

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 1983
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

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

Similar topics

5
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
15
by: Evil Otto | last post by:
My page loads, and calls an init() function that returns content to a div on the page, as well as setting a $_SESSION variable. The content it returns includes a link that calls the same variable,...
7
by: Tony Girgenti | last post by:
Hello. I'm trying to undetrstand ASP.NET 2.0 and javascript. When i have a button and i click on it and i see the web broswer progress bar at the bottom do something, does that mean that there...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
16
by: deostroll | last post by:
Suppose I have an asp page that has a response.write(something) in a loop that would run for a considerable amount of time. Now, from my client browser can I trap those server response messages...
4
by: KDawg44 | last post by:
Hi, I have a feeling this is a dumb question, but I am exploring AJAX and PHP. I would like to write my PHP in an Object Oriented approach. What is the limitation on what I can return in AJAX? ...
7
by: Anil | last post by:
I have a Javascript program which runs in the browser and has functions work(), and stop(). It listens to commands from the server to work() and can be interrupted by the server to stop(). I am...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.