Session Expiry example

{% if error %}

Error logging in

code {{ error['code'] }}

error {{ error['error'] }}

{% end %} {% import time %} {% import json %} {% import gramex %} {% if handler.current_user %}

Your are logged in as:

{{ json.dumps(handler.current_user, indent=4) }}
{% else %}

You are not logged in.

{% end %}

Your session expires in {{ '{:,.0f}'.format(handler.session['_t'] - time.time()) }} seconds

You can log in below as alpha with password alpha. When you log in, your session will expire in {{ '{:,.0f}'.format(handler.kwargs.session_expiry * 24 * 60 * 60) }} seconds. But when you log in through other login pages like simple, the session will expire only after {{ gramex.conf.app.session.expiry }} days.