Bug #71162 [Opn]: lazy_write never call updateTimestamp when session remains empty

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=71162&edit=1

 ID:                 71162
 Updated by:         [email protected]
 Reported by:        e2c2be7ed0f2f336 at gmail dot com
 Summary:            lazy_write never call updateTimestamp when session
                     remains empty
 Status:             Open
 Type:               Bug
 Package:            Session related
 PHP Version:        7.0Git-2015-12-18 (snap)
-Assigned To:        
+Assigned To:        yohgaki
 Block user comment: N
 Private report:     N

 New Comment:

Current session module is designed to write empty session always. I don't think I can change to update time stamp for empty session. (Session module cannot know empty session is new one or not, currently. Session module may detect it, though. This requires yet another state management which is rather complicated already.)

Other than this, I noticed session_set_save_handler() changed the way not to accept SessionIdHandlerInterface nor SessionUpdateTimestampHandlerInterface by someone else.

Therefore, there is no way to use object version of save handler implements SessionIdHandlerInterface or SessionUpdateTimestampHandlerInterface. 

Other parts of object based user save handler implementation needs clean up also. Assign this bug to me for session module clean up in the future.


Previous Comments:
------------------------------------------------------------------------
[2015-12-18 22:54:36] e2c2be7ed0f2f336 at gmail dot com

Description:
------------
A session which remains empty always invoke the write callback instead of updateTimestamp of the session handler.

Not really a bug but behavior would be more consistent.

Test script:
---------------
https://gist.github.com/julp/4bc6acac8ef4ca51e750

Expected result:
----------------
updateTimestamp

Actual result:
--------------
write


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=71162&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.