Django Session Variable and Seriliazation

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/django-session-variable-seriliazation/
PINTEREST
PINTEREST
INSTAGRAM

Django session are used for time the users unique web application usage and gives ability to track users all information like username, basket etc. As I see that django makes usage off sessions very easy with MIDDLEWARE_CLASS SessionMiddleware which is configured in settings.py file. If you will do not use SessinMiddleware disable it in settings.py . The session engine can be configured like caching mechanism.

To handle session object request.session is used as a handler. Mostly used functions are getitem(key) and __setitem(key)__ .like this

To remove all saved session keys use flush() function.

Serializing data can be done with pickle and json but for security reason. Json is used but json supports only basic data types. To use json serializer arbitrary data types you should write you own serializer.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/django-session-variable-seriliazation/
PINTEREST
PINTEREST
INSTAGRAM

LEARN MORE  How To Generate Random Numbers In Linux

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)