CodeIgniter Forums
Session concurrency User Guide edit - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: Session concurrency User Guide edit (/showthread.php?tid=77466)



Session concurrency User Guide edit - ericnagel - 09-04-2020

Not sure of the proper way to suggest a change to the User Guide, but at http://codeigniter.com/user_guide/libraries/sessions.html?#a-note-about-concurrency where it says,

Quote:Locking is not the issue, it is a solution. Your issue is that you still have the session open, while you’ve already processed it and therefore no longer need it. So, what you need is to close the session for the current request after you no longer need it.
PHP Code:
$session->destroy(); 


I don't think $session->destroy(); is the right advice. I had this issue (heavy AJAX / blocked requests) and was happy to find this part of the User Guide. So I destroyed the session at the start of my request (I didn't need it) then I was logged out (of course).

So instead I'm using
PHP Code:
session_write_close(); 

Now my requests are not being blocked by the (slow loading) AJAX request.

If there's another way to suggest changes to the User Guide, please let me know and I'll follow that process.


RE: Session concurrency User Guide edit - MGatner - 09-10-2020

The User Guide is just source code in the main repo. Visit the repo (https://github.com/codeigniter4/CodeIgniter4) and you’ll find a folder “user_guide_src” with all the text. Submitting a Pull Request to change this would be very helpful. If you’ve never done a PR before, don’t be scared! I recommend people try it through GitHub first - navigate to the file you want to change and choose “Edit”. GitHub will walk you through making a fork, committing your changes, and then creating a Pull Request back to the main repo.