简体   繁体   English

如何在symfony2中更改用户的全局会话

[英]how to change global session for user in symfony2

comment changer la session d'utilisateur connecte à une autre session d'utilisateur j'utilise fosuserbundle dans Symfony2 注释更改utilisateur连接会话ut ut utis会话utilisateur j实用程序fosuserbundle dans Symfony2

ex: utilisateur connecter us1 changer session courante à us2 例如:utilisateur连接器us1更改程序会话couranteàus2

In your security.yml allow switch user: 在您的security.yml中,允许切换用户:

firewalls:
    # disables authentication for assets and the profiler, adapt it according to your needs
    admin:
        pattern:      /admin(.*)
        form_login:
            provider:       fos_userbundle
            ...
            failure_path:   null
            ...
            ...
        anonymous:    true
        switch_user: true

Then to switch between users: 然后在用户之间切换:

 To switch to another user
 http://example.com/somewhere?_switch_user=UserName
 To switch back to the original user
 http://example.com/somewhere?_switch_user=_exit 

Try to look at the symfony documentation also : http://symfony.com/doc/current/cookbook/security/impersonating_user.html 也尝试查看symfony文档: http : //symfony.com/doc/current/cookbook/security/impersonating_user.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM