Jump to content

Sessions In AJAX


sid_o

Recommended Posts

Hi,

I am redesigning an application from standard PHP to AJAX style & encounter an issue i can't get around it. i will appreciate any ideas & help.

 

The application is closed to registered users only, & i have a setting for session to be live for 1 hour, when it was standard PHP there was no problem, every page load checked the session & acted accordinly, however in ajax i want to have a function the checks if the session timeout & even if no action has been made from the user the page will automaticly redirect itseld to the login page. But i cant seem to get it, will the call to an AJAX function & from there to a PHP file, will that update the session & therefor prevent it from ever expiring?

 

Cheers

S.

Link to comment
Share on other sites

will that update the session & therefor prevent it from ever expiring?

Yes, if the page has a session_start() statement. The HTTP request for a page that AJAX makes to the web server is exactly the same as any other HTTP request for a page to the web server. The only thing that AJAX adds is that the response back from the web server is processed by javascript within the current page in the browser.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.