Skip to content

[Security] Remember me JSON Login #17676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions security/remember_me.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ Using the remember me cookie is not always appropriate (e.g. you should not
use it on a shared PC). This is why by default, Symfony requires your users
to opt-in to the remember me system via a request parameter.

Remember Me for Form Login
~~~~~~~~~~~~~~~~~~~~~~~~~~

This request parameter is often set via a checkbox in the login form. This
checkbox must have a name of ``_remember_me``:

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

Remember Me for JSON Login
~~~~~~~~~~~~~~~~~~~~~~~~~~

If you implement the login via an API that uses :ref:`JSON Login <json-login>`
you can add a ``_remember_me`` key to the body of your POST request.

.. code-block:: json

{
"username": "[email protected]",
"password": "MyPassword",
"_remember_me": true
}

.. note::

Optionally, you can configure a custom name for this key using the
``name`` setting under the ``remember_me`` section.

Always activating Remember Me
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down