CodeIgniter Forums
Why session->destroy()? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: Why session->destroy()? (/thread-75088.html)



Why session->destroy()? - tgix - 12-18-2019

Currently working on a REST-based backend and as always the questions is about concurrency. Referring to https://codeigniter4.github.io/userguide/libraries/sessions.html and the section "A note about concurrency". Why on earth would I use session->destroy()?!? This will clear out the session and all data. 
Isn't session_write_close() as soon as you can the correct way to handle concurrency?


RE: Why session->destroy()? - dave friend - 12-19-2019

I believe you are correct. The docs should say session_write_close()