-
Notifications
You must be signed in to change notification settings - Fork 62
Sessions generated in 2.8.5 are no longer valid in 2.8.6 #121
Comments
@roelvanduijnhoven Thanks for reporting the issue. I agree, it shouldn't break between any minor release. Please note that Validator\Id was not working properly on PHP 7.1+. Everything depends on your PHP configuration. Can you check what is you PHP setting for |
It is 4 on the new host. And was 5 on the old host! |
@roelvanduijnhoven how do you mean "old" and "new" host? What PHP versions are used on both? Would you be able provide failing test case, so we can investigate and provide a fix, please? |
@webimpress Sorry for the confusion.. we migrated our platform to a new host. But.... that has nothing to do with it ... so forget my previous post! 😅 So: the system is using 7.2.21 and has For everybody reading this, we resolved this by changing the cookie name:
|
Hi @roelvanduijnhoven ! Sorry for my late response. I had closer look on validator and here what we have fixed is to use proper value from configuration ( $pattern = '#^[0-9a-v]*$#'; and now, after the fix it uses: $pattern = '#^[0-9a-f]*$#'; So it is more restrictive in case of allowed characters, but nothing to do with the length. For reference see: zend-session/src/Validator/Id.php Lines 57 to 77 in 86b275a
As you can see, these patter do have any length, so doesn't matter how long is the session id. The only thing this is checking is allowed characters. Can you tell me please how you generate session id? Would you be able to xdebug the code and check what is the source of the issue? If it is something we can fix in the library, we definitely do! Thanks. |
I will be on vacation the next 3 weeks. Will try to get back to you after that! |
@webimpress I know why this happened. We had a migration prior to this issue were the new PHP configuration had However some time later after the update of this repo to 2.8.6 this suddenly gave problems! Why?
This could have been prevented by us by migrating So in theory the 2.8.6 release was a major BC break. But it is very, very specific. My suggestion would be to close this issue. And add a line to the release notes of 2.8.6 as follows:
|
@roelvanduijnhoven Thanks for getting back to me. I've updated CHANGELOG as you've suggested. I see what has happened and it looks like very rare and edge case. We haven't seen any other reports about this issue. Unfortunately sometimes bugfix can cause BC Break, as the code behaviour was incorrect. |
Adding notes about edge case issue with previously generated sessions - issue #121.
That is due to #114. The length of the ID becomes longer after this update for us (PHP 7.2). And Zend Sessions' validation fails.
As there is no system to refresh failed session, we had to chose another cookie name to resolve this issue fully!
I do not exactly what changed, but I think the length of session names should remain identical when doing this minor upgrade, or the old session names should remains valid.
The text was updated successfully, but these errors were encountered: