Comments (12)
I am wondering if it's a change in symfony that broke the functionality or if I am missing some mistake you did in configuring it.. Could you paste your nelmio_security config block?
from nelmiosecuritybundle.
framework:
session:
name: session
cookie_path: /foo/
cookie_httponly: true
cookie_secure: true
handler_id: nelmio_security.session.handler
nelmio_security:
cookie_session:
enabled: true
name: session # the docs says to use cookie_name, but it doesn't actually exist
path: /foo/
secure: true
signed_cookie:
names: ['*']
encrypted_cookie:
names: ['*']
from nelmiosecuritybundle.
Sorry for not getting back to you but I think what might be wrong is that you set
name: session
cookie_path: /foo/
cookie_httponly: true
cookie_secure: true
In the framework.session config. I think you shouldn't and that it might be interfering and you end up with twice the same cookie name, but maybe I'm wrong.
Or did you figure it out?
Aside from that thanks for spotting the docs mistake, I fixed that at least.
from nelmiosecuritybundle.
I removed those configuration lines in framework.session but I end up getting "Your session has timed out, or you have disabled cookies."
When I look in the network inspector for Chrome, I can see the cookies being set in the response, and then sent back in the request, but it seems like the framework doesn't pick it up unless I set framework.session.name.
from nelmiosecuritybundle.
I'm having exactly the same problem (sf 2.5).
It looks like since the native session cookie (PHPSESSID) is being removed by EncryptedCookieListener
and SignedCookieListener
.
The mayor problem is that the session cookie PHPSESSID is not put into the response so EncryptedCookieListener
and SignedCookieListener
can't do there magic on those cookies. A simple check like elseif (!ini_get('session.use_cookies') || $name !== session_name())
instead of else
within the onKernelRequest
would fix the problem but i'm not sure that is the correct way to fix this.
My config:
framework:
session:
storage_id: session.storage.native
handler_id: session.handler.native_file
# Security
nelmio_security:
# signs/verifies all cookies
signed_cookie:
names: ['*']
secret: %cookie_secret%
hash_algo: sha512
# encrypt all cookies
encrypted_cookie:
names: ['*']
secret: %cookie_secret%
algorithm: rijndael-256
# prevents framing of the entire site
clickjacking:
paths:
'^/.*': DENY
from nelmiosecuritybundle.
👍 simply does not work at all with symfony 2.7
I just can not log in if encrypter/singer is enabled.. Debugged and ended up with the same result - cookies are removed from request, and onKernelResponse simply not getting called.
We use Redis to store our sessions.
from nelmiosecuritybundle.
Symfony 2.7 here. Same use case as rodush.
from nelmiosecuritybundle.
Run into the same problem 😞
from nelmiosecuritybundle.
same problem. symfony 3.
from nelmiosecuritybundle.
Think we're hitting the same problem in Symfony 3 (using signed_cookie
).
Edit: recreated locally in my browser, but our tests don't see the problem (tried both Goutte and a real browser using Selenium).
Edit 2: SignedCookieListener::onKernelResponse()
doesn't see the cookie being set, so doesn't get signed. SignedCookieListener::onKernelRequest()
then always fails to check the cookie.
from nelmiosecuritybundle.
Is there any progress or some knowledge about a workaround for this issue? We are experiencing the same issue in a symfony 3.4 project.
from nelmiosecuritybundle.
Closing the issue since SessionCookieHandler
and EncryptedCookieListener
have been removed in 3.0
, feel free to open a new issue if the problem persists.
from nelmiosecuritybundle.
Related Issues (20)
- Can't use environment variables to enable/disable features HOT 2
- Problem with latest Symfony update and signed_cookie feature HOT 5
- Incompatible with Symfony's clearCookie() strategy HOT 1
- cspscript for encore_entry_script_tags and cspstyle for encore_entry_link_tags HOT 4
- Issue with CSP config HOT 2
- Remove "Server" header HOT 1
- Reusing nonce for Turbo Drive integration HOT 1
- Update the description of this GitHub repository HOT 2
- Update the default hashing algorithm used in signed cookies
- DirectiveSet::canNotBeFallbackedByDefault(): Argument #2 ($value) must be of type string, bool given
- Introduce `ExternalRedirectResponse` for more fine-grained redirection control
- When script-src is set to strict-dynamic, 2 nonces are listed in CSP header HOT 2
- CSP interferes with var-dumper HOT 1
- Nonce is empty unless dump using twig HOT 4
- [3.2.0] The report-uri directive has been deprecated HOT 2
- Incompatibility with twig 3.9 HOT 1
- Service dependency injection for controller action: Getting CSP nonce in controller HOT 7
- Unexpecting appearance of unsafe-inline on CSP HOT 4
- Add mechanism to modify directives during or after request handling
- Evaluate/update`PolicyManager`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nelmiosecuritybundle.