Ok, finally, from what I discovered, it seems that any data in $_SESSION
will be flushed to the cookie file.
Can I get somebody's confirmation ?
题
I am using a small PHP framework.
When calling session_start()
, a class implementing SessionHandlerInterface
allows a creation of the cookie file throught its method read($id)
.
A file like sess_533stse23wsdd23rs
is created on disk. Good.
Eventually a further call to the SessionHandlerInterface
implementation writes more information in the cookie server file. This information can be viewed on call to write($id, $data)
.
When debugging, I break in the write
method implementation and view the call stack
and see a call from session_write_close(). I cannot discover where the data passed as parameter to the write
is coming from. I do not seem to have this info from the debugger. This type of information is not accessible:
session_write_close(){
// Where this $data is coming from ?
handler...write( $id, $data )
}
In PHP, is there a method to save information to the cookie, so that a call to the session_write_close() will flush this information to the persistent file on disk ?
解决方案
Ok, finally, from what I discovered, it seems that any data in $_SESSION
will be flushed to the cookie file.
Can I get somebody's confirmation ?