Jump to content

[SOLVED] Sessions with AJAX


gevo12321

Recommended Posts

I was wondering if it is possible to use sessions with ajax. I use AJAX to open tabs on the page for searching. If a tab is clicked, it will search in one database, if the other is clicked it will search in another and I use AJAX because the whole page doesn't have to reload every time the tab is clicked. I was wondering if I could use sessions to remember which tab was clicked. so when another page loads, it remembers which was clicked. So I was wondering how I would implement this. I just don't see what I would do. Thank you.

Link to comment
https://forums.phpfreaks.com/topic/136709-solved-sessions-with-ajax/
Share on other sites

ajax is just a normal client->server page request, so sessions are available just like if they loaded another page from your site. if you want to remember which tab is selected, just pass the tab name in the ajax request, store it in the session, then load it from the session when the new page is loaded. does that make sense?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.