-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explanation of the logic used in this example #36
Comments
Is there a reason you are using If you have set a cookie from |
I guess the logic used here is what confused me and I disagree with. The last thing I expected was this setting to affect anything on the current site based on where the user was before it.
Well, my example above meets that requirement. My example also does not use or care about the cookies from the site it was at previously if any and does not need to access any previously created session/cookie when it is reached. Then you throw in the 'assuming that the browser considers it a safe method, which does not include things like a cross-site POST request'. But remember that I am not using the cookie when I reach this request I am creating it. The issue with my example is the redirect I have in place after I create my session/cookie - because of the redirect, on the same site to the same site, it is chained more or less as being cross-site. If I take the same example above, remove the redirect after creating my session/cookie, and instead use a link on the page to 'continue' it works as I would expect regardless of whether it reached the page cross-site or from a POST request. I guess what I am getting at here is there should be logic that handles this situation. Session/cookie is created on same site, redirect happens to same site, session/cookie should be available on that redirect regardless of how it reached that initial page. It should be handled as if it was a same site link - which it basically is. |
Right, I get you now.
So, for these use cases either:
|
I am implementing samesite and came across a scenario, in my opinion, which does not behave as it should.
a.com
b.com
In this example, the session and cookies, while created on b.com will not exist on b.com/loggedin.php. From my understanding, the samesite logic sees a.com as the top of the chain when it reaches b.com/loggedin.php and eliminates the session/cookies. The problem is they were created on b.com.
One could argue, 'but what if you created something harmful in your session/cookie on b.com because of what was posted from a.com?' Yeah, sure that is possible, but that would be due to poor coding on my part on b.com. I am trying to wrap my head around why they have chosen this route in the example. It is blocking what was CREATED ON the SAMESITE.
The text was updated successfully, but these errors were encountered: