Ticket #13020: sessions.diff
File sessions.diff, 925 bytes (added by , 14 years ago) |
---|
-
docs/topics/http/sessions.txt
313 313 datetime.datetime(2005, 8, 20, 13, 35, 0) 314 314 >>> s.save() 315 315 316 If no ``session_key`` is provided, one will be generated automatically: 317 318 >>> from django.contrib.sessions.backends.db import SessionStore 319 >>> s = SessionStore() 320 >>> s['last_login'] = datetime.datetime(2005, 8, 20, 13, 35, 10) 321 >>> s['last_login'] 322 datetime.datetime(2005, 8, 20, 13, 35, 0) 323 >>> s.save() 324 >>> s.session_key 325 '2b1189a188b44ad18c35e113ac6ceead' 326 316 327 If you're using the ``django.contrib.sessions.backends.db`` backend, each 317 328 session is just a normal Django model. The ``Session`` model is defined in 318 329 ``django/contrib/sessions/models.py``. Because it's a normal model, you can