In Django, how can I find out the request.session sessionid and use it as a variable?

前端 未结 8 877
借酒劲吻你
借酒劲吻你 2020-12-13 03:08

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

8条回答
  •  甜味超标
    2020-12-13 03:40

    You can check in your sessions too:

    If "var" in request.session:
           Var = request.session['var']
            Return httpResponse("set")
    Else:
           Return httpResponse("there isn't")
    

提交回复
热议问题