Categories
Python Answers

How to expire Python Django session in 5 minutes?

Spread the love

Sometimes, we want to expire Python Django session in 5 minutes.

In this article, we’ll look at how to expire Python Django session in 5 minutes.

How to expire Python Django session in 5 minutes?

To expire Python Django session in 5 minutes, we can set the SESSION_COOKIE_AGE setting in settings.py.

For instance, we write

SESSION_COOKIE_AGE = 5*60

in settings.py to set sessions to expire in 5 minutes.

Conclusion

To expire Python Django session in 5 minutes, we can set the SESSION_COOKIE_AGE setting in settings.py.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *