[PYTHON] I checked the session retention period of django

Question

If you restart the app with runserver while creating the django app Even if I reloaded the screen or hit the URL directly, I was still logged in. I doubted the @login_required defined in views.py, but there was no problem.

When is the login session updated in the first place? Make a memorandum of what you have learned about the login session, how long it will be retained.

For the django session, I mainly referred to ↓

I / O of session information

Session information manages session information data in the django_sessino table. Session data is inserted at login, and session data is deleted at logout. That is, authentication is in progress while session information data is registered in the django_sessino table.

The above is how to manage sessions using the database. Session management methods using files and cookies are excluded.

Session persistence

Whether to discard the session when the browser is closed is controlled by the parameter SESSION_EXPIRE_AT_BROWSER_CLOSE, and the default value is ** False **.

Session at browser exit

If SESSION_EXPIRE_AT_BROWSER_CLOSE is False, the session information is stored in the user's cookie. The retention period is controlled by the SESSION_COOKIE_AGE parameter and the default value is 1209600 (** 2 weeks in seconds **).

Summary

Recommended Posts

I checked the session retention period of django
I checked the contents of docker volume
I tried the asynchronous server of Django 3.0
I checked the options of copyMakeBorder of OpenCV
I checked the processing speed of numpy one-dimensionalization
I checked the output specifications of PyTorch's Bidirectional LSTM
I checked out the versions of Blender and Python
I checked the default OS and shell of docker-machine
I participated in the translation activity of Django official documents
Change the log retention period of CloudWatch Logs in Lambda
I investigated the mechanism of flask-login!
The meaning of ".object" in Django
I checked the gift tax amount
I checked the distribution of the number of video views of "Flag-chan!" [Python] [Graph]
I checked the usage status of the parking lot from satellite images.
I checked the image of Science University on Twitter with Word2Vec.
How to check the version of Django
I summarized the folder structure of Flask
I didn't know the basics of Python
The Python project template I think of.
I checked the number of closed and opened stores nationwide by Corona
I read the implementation of golang channel
Consider the description of docker-compose.yml (Django + MySQL ③)
I tried to summarize the settings for various databases of Django (MySQL, PostgreSQL)
I failed to install django with pip, so a reminder of the solution
I tried the pivot table function of pandas
I checked the library for using the Gracenote API
I tried cluster analysis of the weather map
I read the implementation of range (Objects / rangeobject.c)
I solved the deepest problem of Hiroshi Yuki.
Exclusive release of the django app using ngrok
I tried to touch the API of ebay
I tried to correct the keystone of the image
Try the free version of Progate [Python I]
I touched some of the new features of Python 3.8 ①
The story of viewing media files in Django
I read and implemented the Variants of UKR
I want to customize the appearance of zabbix
I checked the calendar deleted in Qiita Advent Calendar 2016
I tried using the image filter of OpenCV
I tried to predict the price of ETF
I tried to vectorize the lyrics of Hinatazaka46!
When I checked the query generated by Django, it was issued in large numbers
[SLAYER] I visualized the lyrics of thrash metal and checked the soul of steel [Word Cloud]
I just wanted to extract the data of the desired date and time with Django
I tried Django
The wall of changing the Django service from Python 2.7 to Python 3
[Trainer's Recipe] I touched the flame of the Python framework.
I want to grep the execution result of strace
I want to scroll the Django shift table, but ...
I tried to summarize the basic form of GPLVM
I tried the MNIST tutorial for beginners of tensorflow.
I followed the implementation of the du command (first half)
I compared the identity of the images by Hu moment
I want to fully understand the basics of Bokeh
The performance of PHP was better than I expected
I examined the argument class_weight of Chainer's softmax_cross_entropy function.
[Django] Change the Default IP address of the runserver command
I followed the implementation of the du command (second half)
I tried using the API of the salmon data project
I tried to visualize the spacha information of VTuber