Django

Code

Changeset 1044

Show
Ignore:
Timestamp:
11/02/05 08:26:55 (3 years ago)
Author:
adrian
Message:

Added 'Session IDs in URLs' and 'Session cookies' sections to docs/sessions.txt

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/sessions.txt

    r867 r1044  
    159159    {'user_id': 42} 
    160160 
     161Session cookies 
     162=============== 
     163 
     164A few `Django settings`_ give you control over the session cookie: 
     165 
     166SESSION_COOKIE_AGE 
     167------------------ 
     168 
     169Default: ``1209600`` (2 weeks, in seconds) 
     170 
     171The age of session cookies, in seconds. 
     172 
     173SESSION_COOKIE_DOMAIN 
     174--------------------- 
     175 
     176Default: ``None`` 
     177 
     178The domain to use for session cookies. Set this to a string such as 
     179``".lawrence.com"`` for cross-domain cookies, or use ``None`` for a standard 
     180domain cookie. 
     181 
     182SESSION_COOKIE_NAME 
     183------------------- 
     184 
     185Default: ``'hotclub'`` 
     186 
     187The name of the cookie to use for sessions. This can be whatever you want. 
     188 
     189``'hotclub'`` is a reference to the Hot Club of France, the band Django 
     190Reinhardt played in. 
     191 
     192.. _Django settings: http://www.djangoproject.com/documentation/settings/ 
     193 
    161194Technical details 
    162195================= 
     
    171204 
    172205.. _`the pickle module`: http://www.python.org/doc/current/lib/module-pickle.html 
     206 
     207Session IDs in URLs 
     208=================== 
     209 
     210The Django sessions framework is entirely, and solely, cookie-based. It does 
     211not fall back to putting session IDs in URLs as a last resort, as PHP does. 
     212This is an intentional design decision. Not only does that behavior make URLs 
     213ugly, it makes your site vulnerable to session-ID theft via the "Referer" 
     214header.