LoginSignup
2
2

More than 5 years have passed since last update.

web2pyのcookieの有効期限を変更する方法

Posted at

cookieの有効期限を設定していなかったせいではまったのでメモ。

次のコードで有効期限を変更できる。
最終アクセス日からの秒数で指定

db.py
response.cookies[response.session_id_name]['expires'] = 3600 * 24 * 30

この例では最終アクセス日から30日間有効となる。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2