symfony - Symfony2 security session ending and no redirection -
i have problem in symfony2 project. sometimes, when i'm logged in, disconnected on random intervals of time, 2 hours, 2 minutes later.
but real problem i'm not redirected login form. i'm displaying name of logged user in layout file, , error :
impossible access attribute ("member") on string variable ("anon.") in appbundle:layout:top_menu.html.twig @ line 25
when wild forced logout.
here security.yml file
security: providers: insiders: entity: class: interne\securitybundle\entity\user property: username encoders: interne\securitybundle\entity\user: plaintext firewalls: interne: pattern: ^/ anonymous: ~ form_login: login_path: /login check_path: /login_check default_target_path: /interne logout: path: /logout target: /login access_control: - { path: ^/interne, roles: role_admin}
any appreciated ! lot !
use in top_menu:
{% if is_granted('is_authenticated_fully') %} <p>username: {{ app.user.username }}</p> {% endif %}
http://symfony.com/doc/current/book/security.html#retrieving-the-user-object
Comments
Post a Comment