Skip to content
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

Session cookies decoding error #2320

Closed
Rubenfer opened this issue Apr 17, 2020 · 3 comments
Closed

Session cookies decoding error #2320

Rubenfer opened this issue Apr 17, 2020 · 3 comments
Labels
bug Something isn't working
Projects

Comments

@Rubenfer
Copy link

Vapor 4 doesn't decode cookies when other cookies are sent.

Normally, we use localhost as test host with a lot of environments in different ports. I notice that in the login form if the browser sends other cookies, the Vapor session is not working properly. The external cookies are sent in a UUID format.

Steps to reproduce

In a login form sent other cookies in a UUID format (not just Vapor generated cookie).

Expected behavior

The session data persists.

Actual behavior

The session data doesn't persist. It is empty when external cookies are sent.

Environment

  • Vapor Framework version: 4.2.0
@tanner0101 tanner0101 added the bug Something isn't working label Apr 17, 2020
@tanner0101 tanner0101 added this to To Do in Vapor 4 via automation Apr 17, 2020
@tanner0101
Copy link
Member

tanner0101 commented Apr 17, 2020

@Rubenfer that should work. Maybe this is related to #2316. Can you share the HTTP request headers that are causing the problem?

@Rubenfer
Copy link
Author

I have been doing some tests to find the error.
Looks like it fails when in headers are sent a cookie with a number in the name. The best way to try it is customize the vapor cookie name, for example:
app.sessions.configuration.cookieName = "session_1234_my_service"
So the issue is related to #2316.

@tanner0101
Copy link
Member

Ah okay, updating to 4.2.1 should fix that then: https://github.com/vapor/vapor/releases/tag/4.2.1

Vapor 4 automation moved this from To Do to Done Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Vapor 4
  
Done
Development

No branches or pull requests

2 participants