You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by wurst-hans October 19, 2022 Really?
I'm going to upgrade my middleware and projects from v4 to v5 and have been looking for hours, why my custom session handler does not work anymore. It causes PHP to create a new session ID on every request.
My session handler uses Random to generate a UUID v4 to be used as session ID.
After hours I found out, that Phalcon session manager checks session cookie value with following regex /^[a-z0-9]+$/iD. That explains, why my UUID is being ignored. That's a pity.
It should not be your (i.e. Phalcons) task to decide if a session ID is valid. When implementing a custom session handler (like I did) one can implement the SessionIdInterface which provides not only the create_sid() method but also a validateId() method that can be used for validating session ID.
The text was updated successfully, but these errors were encountered:
Discussed in #16169
Originally posted by wurst-hans October 19, 2022
Really?
I'm going to upgrade my middleware and projects from v4 to v5 and have been looking for hours, why my custom session handler does not work anymore. It causes PHP to create a new session ID on every request.
My session handler uses
Random
to generate a UUID v4 to be used as session ID.After hours I found out, that Phalcon session manager checks session cookie value with following regex
/^[a-z0-9]+$/iD
. That explains, why my UUID is being ignored. That's a pity.It should not be your (i.e. Phalcons) task to decide if a session ID is valid. When implementing a custom session handler (like I did) one can implement the
SessionIdInterface
which provides not only thecreate_sid()
method but also avalidateId()
method that can be used for validating session ID.The text was updated successfully, but these errors were encountered: