亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Symfony 4 記住我 cookie 未設置

Symfony 4 記住我 cookie 未設置

PHP
人到中年有點甜 2022-05-27 16:16:39
我正在使用 Symfony 4 開發一個站點,我注意到記住我的功能不起作用(根本沒有設置 cookie)。我遵循了本教程:https://symfony.com/doc/4.4/security/remember_me.html我也閱讀了很多類似的問題,但沒有一個能解決我的問題。這是我的 security.yaml 配置:security:    encoders:        App\Entity\User:            algorithm: auto    # https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers    providers:        # used to reload user from session & other features (e.g. switch_user)        app_user_provider:            entity:                class: App\Entity\User                property: username    firewalls:        dev:            pattern: ^/(_(profiler|wdt)|css|images|js)/            security: false        main:            anonymous: lazy            guard:                authenticators:                    - App\Security\LoginFormAuthenticator            logout:                path: app_logout                # where to redirect after logout                # target: app_any_route            remember_me:                secret:   '%kernel.secret%'                lifetime: 604800 # 1 week in seconds                path:     /            # 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 }        # - { path: ^/profile, roles: ROLE_USER }這是我的表格:<form method="post">    <div class="form-group">        <label for="inputUsername">Username</label>        <input type="text" value="{{ last_username }}" name="username" id="inputUsername" class="form-control" required autofocus>    </div>    <div class="form-group">        <label for="inputPassword">Password</label>        <input type="password" name="password" id="inputPassword" class="form-control" required>    </div>
查看完整描述

1 回答

?
手掌心

TA貢獻1942條經驗 獲得超3個贊

這已被確認為一個錯誤,并已在 Symfony 版本 4.4.1 中解決。如果您遇到此錯誤,請從 4.4.0 升級到 4.4.1。

這是修復此問題的提交:https ://github.com/symfony/symfony/pull/34627

這些是變更日志:https ://symfony.com/blog/symfony-4-4-1-released


查看完整回答
反對 回復 2022-05-27
  • 1 回答
  • 0 關注
  • 132 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號