2015-05-31 28 views
0

我的Symfony2項目存在問題。有時,當我登錄時,我會隨機分配時間間隔,有時2小時,有時2分鐘後。Symfony2安全會話結束並且不重定向

但真正的問題是我沒有重定向到我的登錄表單。我在我的佈局文件中顯示登錄用戶的名稱,並得到此錯誤:

Impossible to access an attribute ("member") on a string variable ("anon.") in AppBundle:Layout:top_menu.html.twig at line 25 

當我得到狂野的強制註銷。

這裏是我的security.yml文件

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} 

任何幫助將非常感激!非常感謝 !在top_menu

回答