Skip to content

Commit 3b619b1

Browse files
committed
minor #17676 [Security] Remember me JSON Login (baumerdev)
This PR was merged into the 6.3 branch. Discussion ---------- [Security] Remember me JSON Login Add block with description, how to set up remember me functionality for JSON Login Issue symfony/symfony#40918 Pull Request symfony/symfony#48899 Commits ------- 4397755 Add JSON login remember me symfony/symfony#48899
2 parents 581a54f + 4397755 commit 3b619b1

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

security/remember_me.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ Using the remember me cookie is not always appropriate (e.g. you should not
108108
use it on a shared PC). This is why by default, Symfony requires your users
109109
to opt-in to the remember me system via a request parameter.
110110

111+
Remember Me for Form Login
112+
~~~~~~~~~~~~~~~~~~~~~~~~~~
113+
111114
This request parameter is often set via a checkbox in the login form. This
112115
checkbox must have a name of ``_remember_me``:
113116

@@ -130,6 +133,25 @@ checkbox must have a name of ``_remember_me``:
130133
Optionally, you can configure a custom name for this checkbox using the
131134
``name`` setting under the ``remember_me`` section.
132135

136+
Remember Me for JSON Login
137+
~~~~~~~~~~~~~~~~~~~~~~~~~~
138+
139+
If you implement the login via an API that uses :ref:`JSON Login <json-login>`
140+
you can add a ``_remember_me`` key to the body of your POST request.
141+
142+
.. code-block:: json
143+
144+
{
145+
"username": "[email protected]",
146+
"password": "MyPassword",
147+
"_remember_me": true
148+
}
149+
150+
.. note::
151+
152+
Optionally, you can configure a custom name for this key using the
153+
``name`` setting under the ``remember_me`` section.
154+
133155
Always activating Remember Me
134156
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135157

0 commit comments

Comments
 (0)