Welcome Guest, Not a member yet? Register   Sign In
CI sessions and session_write_close()
#1

Hello,

My application is seeing issues with mysql threads waiting for locks on the ci_sessions table.

I was reading through the documentation and saw that calling session_write_close() after I am done with writing session information should fix the issue I am seeing (I think?).

My question is does this mean I can no longer write to the session in just this controller function or for the remainder of the users session?  ie. If I call session_write_close() at the end of a checkout function within a controller, would I not be able to write to the session in the next server request on the process function within the same controller?

Thanks for any help.

-Mike
Reply
#2

(This post was last modified: 07-12-2016, 07:10 AM by PaulD. Edit Reason: Added clarification )

Hi,

I have not experienced this but according to the docs:

http://www.codeigniter.com/user_guide/li...oncurrency

It seems that you should call this once you have finished dealing with the sessions records for that entire request.

Your next request will not be affected by manually closing and unlocking the record in this request.

Hope that helps,

Paul.

EDIT for clarification: You asked "would I not be able to write to the session in the next server request", no, you are able to write to the session in the next server request.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB