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

device_view cookie does not respect framework cookie configuration #106

Open
tina-junold opened this issue Mar 26, 2017 · 7 comments
Open

Comments

@tina-junold
Copy link

The device_view cookie should respect (and use) the "cookie-*" and "httponly" parameters, since currently it lowers security. The cookie is allowed also for http, but my (server/symfony) configuration does not allow it: Mozilla Observatory - "Cookies set without using the Secure flag, but transmission over HTTP prevented by HSTS"

@OneWeb
Copy link

OneWeb commented Apr 6, 2018

I just had this flagged from a security scan as an issue and have had to remove this bundle from my project, unfortunately. Is there a workaround to force the device_view cookie to be secure?

@xabbuh
Copy link
Contributor

xabbuh commented Apr 6, 2018

Which settings are you talking about? Can you show an example?

@OneWeb
Copy link

OneWeb commented Apr 8, 2018

@xabbuh
Copy link
Contributor

xabbuh commented Apr 9, 2018

That's the expected behaviour. The configuration setting you linked to is not taken into account for all cookies but only affects the session cookie. See symfony/symfony#26731 for a similar feature request in the Symfony core.

@OneWeb
Copy link

OneWeb commented Apr 9, 2018

Thanks for pointing this out, I was not aware. Is there a way to make the cookie secure on this MobileDetectBundle?

@xabbuh
Copy link
Contributor

xabbuh commented Apr 9, 2018

You can create your own event listener that modifies the cookie accordingly.

@ghost
Copy link

ghost commented Mar 14, 2019

Why not setting the const COOKIE_SECURE_DEFAULT = true; in the Helper/DeviceView.php file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants