Phalcon v5 forces strict session ID syntax #16169
wurst-hans
started this conversation in
General
Replies: 1 comment 2 replies
-
@wurst-hans If possible can you post a sample handler? I want to use it to create a test for this.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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.Beta Was this translation helpful? Give feedback.
All reactions