Welcome Guest, Not a member yet? Register   Sign In
Using Session with a lot of AJAX
#5
Music 

(12-08-2021, 05:14 PM)includebeer Wrote: Yikes! The doc is wrong! session_destroy() or $session->destroy() will do exactly that, destroy the session and log out the user. You should call session_write_close() to save the session and release the lock. There's even a paragraph almost at the end of the page that says to use session_write_close():
Quote:Important

Only MySQL and PostgreSQL databases are officially supported, due to lack of advisory locking mechanisms on other platforms. Using sessions without locks can cause all sorts of problems, especially with heavy usage of AJAX, and we will not support such cases. Use session_write_close() after you’ve done processing session data if you’re having performance issues.

Hi, I am facing a lot of problems with a project of mine which is using a lot of ajax calls. Very often the session is spontaneously closing, redirecting the user to the login page.
In your post, are you saying to use session_write_close() instead of destroy() ?
Thank you
Reply


Messages In This Thread
Using Session with a lot of AJAX - by Jag81 - 12-08-2021, 09:33 AM
RE: Using Session with a lot of AJAX - by gbwebapps - 12-11-2021, 05:04 PM
RE: Using Session with a lot of AJAX - by kenjis - 12-11-2021, 06:07 PM
RE: Using Session with a lot of AJAX - by kenjis - 12-08-2021, 06:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB