-
-
Notifications
You must be signed in to change notification settings - Fork 374
Bug fix for incorrect SameSite=none behaviour on some platforms. #386
Conversation
…ents. Instead of manually generating the major and minor numbers of a version, to rely on the Agent library's built in tools.
… now using Semver. previously, it would only receive bug-fixes to 6.0, but now minor releases are in 6.* as well.
@mferrario @muhammadasfar Could you guys share some user agents that you've seen fail on your app so we can add it to the tests to confirm that this fixes the issues you're seeing? |
@darrynten Would like your feedback on this PR |
@darrynten also right now the logic is a whitelist of compatible browsers rather than a blacklist of incompatible browsers. Based on the Chrome team's writeup, they suggest the blacklist as all other browsers should not have an issue with the new cookie flag. We also do expect more browsers to follow suit in the future, so having a blacklist might make more sense since there won't be a need to keep updating the code every time a new browser vendor adopts the same requirement. |
I am using chrome 80 Beta and user agents is
Domain: https://myprojectname.test In my case this function return is And now I am trying this version release on my live app domain for confirmation. |
… means that bad agents will be treated as compatible by default.
…d by user-agents with more than 1 keyword.
@jedimdan here are two examples: My Code: // print |
@mferrario Could you try printing |
@darrynten by the way, apologies for not spotting and highlighting some of these in your original PR. |
Feel free to tag me once you feel its out of draft, and I'll gladly push a patch release. |
Here are some new examples: //PRINT // OUTPUT |
@darrynten One more thing I wanted to ask: with the change to relying on the Agent class' built-in float versions, I assume the try-catch is no longer necessary? Also, let me know if my answers to your comments are acceptable. |
…here an exception would occur
@jedimdan yes, it seems the try/catch will not be needed anymore |
Thanks, @ohmybrew, this PR is ready. Thanks @darrynten for the review! |
Thanks!
Will do this tonight.
|
A bug was discovered from PR #382 in
ShopSession.php
's newgetBrowserDetails()
andgetPlatformDetails()
method that causes the app to not return SameSite=none on some platforms. This is likely caused by the fact that some platform's version numbers do not have a minor number.The proposed fix is to rely on
Jenssegers\Agent
's built-in functions that can generate a float version number from any user-agent.Reference: #382 (comment)_
Other fixes include:
SameSite=None
is expected to be a norm on more browsers moving forward (Refer to this comment)