Skip to content

Commit 4397755

Browse files
committed
Add JSON login remember me symfony/symfony#48899
1 parent 93bfba3 commit 4397755

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
@@ -111,6 +111,9 @@ Using the remember me cookie is not always appropriate (e.g. you should not
111111
use it on a shared PC). This is why by default, Symfony requires your users
112112
to opt-in to the remember me system via a request parameter.
113113

114+
Remember Me for Form Login
115+
~~~~~~~~~~~~~~~~~~~~~~~~~~
116+
114117
This request parameter is often set via a checkbox in the login form. This
115118
checkbox must have a name of ``_remember_me``:
116119

@@ -133,6 +136,25 @@ checkbox must have a name of ``_remember_me``:
133136
Optionally, you can configure a custom name for this checkbox using the
134137
``name`` setting under the ``remember_me`` section.
135138

139+
Remember Me for JSON Login
140+
~~~~~~~~~~~~~~~~~~~~~~~~~~
141+
142+
If you implement the login via an API that uses :ref:`JSON Login <json-login>`
143+
you can add a ``_remember_me`` key to the body of your POST request.
144+
145+
.. code-block:: json
146+
147+
{
148+
"username": "dunglas@example.com",
149+
"password": "MyPassword",
150+
"_remember_me": true
151+
}
152+
153+
.. note::
154+
155+
Optionally, you can configure a custom name for this key using the
156+
``name`` setting under the ``remember_me`` section.
157+
136158
Always activating Remember Me
137159
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
138160

0 commit comments

Comments
 (0)