简体   繁体   English

ISPconfig Ubuntu服务器上的Symfony2登录问题

[英]Symfony2 on ISPconfig Ubuntu server log in problems

I have a problem using Symfony2 on ISPconfig ubuntu server. 我在ISPconfig ubuntu服务器上使用Symfony2时遇到问题。 Server uses multiple php versions and I use php 5.5.9 version for Symfony application. 服务器使用多个php版本,而我使用Symfony应用程序的php 5.5.9版本。 Application works fine, but when I log in, it randomly logs me out (especially when i refresh or move to another page). 应用程序运行良好,但是当我登录时,它会随机将我注销(特别是当我刷新或移至另一页面时)。 And also, sometimes it won't even let me log in; 而且,有时它甚至不让我登录; it redirects me back to the login page without authentication. 它将我重定向到登录页面而无需身份验证。

Thing is, the application works perfectly on a different Ubuntu server (not ispconfig). 事实是,该应用程序可以在其他Ubuntu服务器(而不是ispconfig)上完美运行。 I made sure that ispconfig php.ini file and other configurations be set up correctly. 我确保正确设置了ispconfig php.ini文件和其他配置。

Do you have any ideas why I could be having login problems on ISPconfig? 您有什么想法为什么我可能在ISPconfig上出现登录问题?

I had a similar problem and I managed to solve it by adding: post_only: true 我有一个类似的问题,我设法通过添加来解决它:post_only:true

to my security.yml file under the firewalls section. 到“防火墙”部分下的我的security.yml文件。 So it looks like this now: 所以现在看起来像这样:

firewalls:
    secured_area:
        pattern: ^/
        anonymous:  ~
        provider: chain_provider
        form_login:
            login_path: /login
            check_path: /login_check
            default_target_path: example_route
            #remember_me: true
            post_only:  true
        logout:
            path: /logout
            target: /

To be honest, I am not entirely sure why it worked, but I think this makes sure that login is requested only with POST method. 老实说,我不完全确定为什么它起作用,但是我认为这可以确保仅使用POST方法请求登录。 Not to mention that I have a multi cluster setup, with different versions of php installation. 更不用说我有一个多集群安装程序,安装了不同版本的php。

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

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