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 sessionid as a variable
request.session[\'variable_name\']
In Django 1.8:
request.session.session_key
and
request.session._session_key
Both work correctly.
in Django >= 1.4 use: