I'm aware that you can get session variables using request.session['variable_name'], but there doesn't seem to be a way to grab the session id as a variable in a similar way. Is this documented anywhere? I can't find it.
request.session['variable_name']
request.session.session_key
Note the key will only exist if there is a session, no key, no session. You can use this to test if a session exists. If you want to create a session, call create.
1.4m articles
1.4m replys
5 comments
57.0k users