Django Session Variable and Seriliazation

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 aregetitem(key) and __setitem(key)__ .like this

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.