﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32952	Django is not generating new session	Inexpli	nobody	"While i was creating shopping cart which depends on sessionid included in cookie files I once removed sessionid in my browser to test something and then i realised that django don't want to recreate new one. I was looking for solution in internet but i didn't found any equal problem to my and solution to it.

By looking on the django docs. i wrote to setting.py hoping that it would help:

{{{
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'

SESSION_COOKIE_HTTPONLY = True
}}}

but still sessionid in cookies doesn't occur.

I read post that sessionid should be generated by django while there is request which require sessionid, and it would be in my situation solution on this problem but in the context_processors.py I wrote that i require sessionid globally:


{{{
def basket(request):
    try:
        customer = request.user.customer
    except:
        device = request.COOKIES['sessionid']

        customer, created = Customer.objects.get_or_create(device=device)

    order, created = Order.objects.get_or_create(
        customer=customer, complete=False)

    return {
        'order': order,
    }
}}}

And beacouse of the context_processors sends request for sessionid and it can't get one, this error occurs:
https://i.stack.imgur.com/D3d9U.png"	Bug	closed	contrib.sessions	3.2	Normal	invalid	session, cookies		Unreviewed	0	0	0	0	0	0
