Symfony 2 "Your session has ended or you have disabled cookies"

One of the three reasons caused this, and I'm not sure which one was. Therefore, I mentioned all 3 in the hope that this will help others save time.

I initially changed the database user credentials in the .yml options. This does not work because the user in question cannot log in with localhost. However, I used the site to test the connection, which could upset the cookie.

I am having problems accessing the cache folder due to a missing image. So I had to clear the cache and configure some permissions, like you do every time.

Finally, I changed the paths for security.yml

form_login: login_path: /login check_path: /login_check logout: path: /logout 

in

  form_login: login_path: /account/login check_path: /account/login_check logout: path: /account/logout 

Along with related changes in .yml routing

As a result, my already registered user no longer transmitted security credentials, and if I tried to log in using another user / browser, I always came across: "Your session timed out or you turned off cookies"

Numerous hours have been spent after red herring, security checks, login processing, redis, etc.

The answer is below.

+6
source share
1 answer

In the end, I found the answer here: Symfony authentication - cannot go through the login page (response from pleerock user)

But I wanted to associate the error message in the subject line with this solution below:

 security: firewalls: main: form_login: require_previous_session: false 

This fixed the problem for browsers that were not logged in before the problem occurred.

For my browser, which was already registered, I had to manually delete the session cookie in order for everything to work again.

+8
source

Source: https://habr.com/ru/post/977591/


All Articles