php - 生产服务器上的 Symfony 4.4.17 注销问题
问题描述
我对 Symfony 4.4.17 的生产有一个奇怪的问题,在本地运行良好。
我在开发环境中使用 PHP 7.3.21,在产品环境中使用 PHP 7.3.23。
注销不起作用,prod.log 或浏览器控制台中没有错误。
安全.yaml:
security:
encoders:
App\Entity\User:
algorithm: auto
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers
providers:
app_user_provider:
entity:
class: App\Entity\User
property: email
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: lazy
guard:
authenticators:
- App\Security\AppAuthenticator
logout:
path: app_logout
target: homepage
remember_me:
secret: '%kernel.secret%'
lifetime: 604800 # 1 week in seconds
path: /
form_login:
login_path: homepage
default_target_path: profile
use_referer: true
json_login:
check_path: signin_ajax
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#firewalls-authentication
# https://symfony.com/doc/current/security/impersonating_user.html
# switch_user: true
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control:
- { path: ^/admin, roles: ROLE_ADMIN }
安全控制器.php:
/**
* @Route("/logout", name="app_logout", methods={"GET"})
*/
public function logoutAction()
{
throw new \Exception('This method can be blank - it will be intercepted by the logout key on your firewall');
}
cookie 似乎很好,这是它的数据:
有任何想法吗?
解决方案
非常遗憾。有人写了一个与注销路径冲突的 .htaccess 规则。谜团已揭开
推荐阅读
- objective-c - Mojave/macOS 10.14.0:[AVPlayerItem 持续时间] 始终是不确定的
- rest - 如何使用 Golang 实现导入数据功能?
- redis - 如何使用 JEDISCLUSTER 客户端搜索 Redis 中的键空间?
- c++ - 为什么显式模板实例化不会破坏 ODR?
- sql-server - 我该怎么做 1 单击执行此 T-SQL
- python - 使用python从某行中查找空行的行号
- sql - 将 NULL 视为最大可能值
- javascript - 如何滚动以生成本机 javascript?
- pyspark - 将 df.show() 的内容保存为 pyspark 中的字符串
- matlab - MATLAB 神经网络中不同长度的输入