1>>> from django.contrib.sessions.backends.db import SessionStore
2>>> s = SessionStore()
3>>> # stored as seconds since epoch since datetimes are not serializable in JSON.
4>>> s['last_login'] = 1376587691
5>>> s.create()
6>>> s.session_key
7'2b1189a188b44ad18c35e113ac6ceead'
8>>> s = SessionStore(session_key='2b1189a188b44ad18c35e113ac6ceead')
9>>> s['last_login']
101376587691
11
1>>> s.session_data
2'KGRwMQpTJ19hdXRoX3VzZXJfaWQnCnAyCkkxCnMuMTExY2ZjODI2Yj...'
3>>> s.get_decoded()
4{'user_id': 42}
5
1>>> from django.contrib.sessions.models import Session
2>>> s = Session.objects.get(pk='2b1189a188b44ad18c35e113ac6ceead')
3>>> s.expire_date
4datetime.datetime(2005, 8, 20, 13, 35, 12)
5