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

Auto protected session cookie #63

Open
staabm opened this issue Aug 28, 2017 · 5 comments
Open

Auto protected session cookie #63

staabm opened this issue Aug 28, 2017 · 5 comments

Comments

@staabm
Copy link

staabm commented Aug 28, 2017

Atm the lib uses a hardcoded list of possible cookie names/substring.

protected $protectedCookies = [

Wouldnt it make sense to detect whether sessions are handled via cookies and if so add the session cookies name to the protectedCookies list?

@aidantwoods
Copy link
Owner

Wouldnt it make sense to detect whether sessions are handled via cookies and if so add the session cookies name to the protectedCookies list?

I like the idea here :D

So the suggestion is to poll session_name and use the result from that as a protected cookie name, alongside the existing names and substrings?

@staabm
Copy link
Author

staabm commented Aug 28, 2017

Exactly. I would check before whether the session will be cookie based

@staabm
Copy link
Author

staabm commented Aug 28, 2017

See session.use_cookies on http://php.net/manual/en/session.configuration.php

@aidantwoods
Copy link
Owner

Yup, I'll take a look at doing that – cheers for the links.

In-fact, if a session isn't cookie based, I wonder whether SecureHeaders should say something to encourage use of cookies to allow better protection methods by the browser (and also so the application doesn't leak the SID on navigation if an insufficient referrer policy is set).

Though, since 2.0 the default header set will issue a referrer policy to protect that leakiness on navigation, still might be worth the added sanity check if we're already polling the ini for the cookie name and other session info.

@aidantwoods
Copy link
Owner

Oops I left this a while longer than I wanted too 😬
I'll pick up on this up later today hopefully

@aidantwoods aidantwoods added this to the Version 2.1 milestone Jan 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants