Session
The session
object represents the current user’s session, including login status and cookie policy.
Usage Example
{%- comment -%} Show login/logout link based on session {%- endcomment -%}
{% if session.logged_in %}
<a href="{{ routes.account_logout_url }}">Logout</a>
{% else %}
<a href="{{ routes.account_login_url }}">Login</a>
{% endif %}
Properties
cookie_policy
Returns the cookie policy for the session.
logged_in
Returns true if the user is currently logged in.
Last updated on