Skip to content

Commit 6de9b0f

Browse files
committed
minor #18995 [Security] Explain that IS_AUTHENTICATED_REMEMBERED should not be used (javiereguiluz)
This PR was merged into the 6.4 branch. Discussion ---------- [Security] Explain that `IS_AUTHENTICATED_REMEMBERED` should not be used Commits ------- 503aba1 [Security] Explain that IS_AUTHENTICATED_REMEMBERED should not be used
2 parents c276932 + 503aba1 commit 6de9b0f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

security.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,11 +2666,6 @@ You can use ``IS_AUTHENTICATED`` anywhere roles are used: like
26662666
user that has logged in will have this. Actually, there are some special attributes
26672667
like this:
26682668

2669-
* ``IS_AUTHENTICATED_REMEMBERED``: *all* logged in users have this, even
2670-
if they are logged in because of a "remember me cookie". Even if you don't
2671-
use the :doc:`remember me functionality </security/remember_me>`,
2672-
you can use this to check if the user is logged in.
2673-
26742669
* ``IS_AUTHENTICATED_FULLY``: This is similar to ``IS_AUTHENTICATED_REMEMBERED``,
26752670
but stronger. Users who are logged in only because of a "remember me cookie"
26762671
will have ``IS_AUTHENTICATED_REMEMBERED`` but will not have ``IS_AUTHENTICATED_FULLY``.
@@ -2683,6 +2678,15 @@ like this:
26832678
:doc:`impersonating </security/impersonating_user>` another user in this
26842679
session, this attribute will match.
26852680

2681+
.. note::
2682+
2683+
All logged in users also have an attribute called ``IS_AUTHENTICATED_REMEMBERED``,
2684+
even if the application doesn't use the Remember Me feature. This attribute
2685+
exists for backward-compatibility reasons with Symfony versions prior to 6.4.
2686+
2687+
This attribute behaves the same as ``IS_AUTHENTICATED``. That's why in modern
2688+
Symfony applications it's recommended to no longer use ``IS_AUTHENTICATED_REMEMBERED``.
2689+
26862690
.. _user_session_refresh:
26872691

26882692
Understanding how Users are Refreshed from the Session

0 commit comments

Comments
 (0)