Hi,

I'm trying to pay around with sessions and here is how it's setup:

MIDDLEWARE_CLASSES = (
...
    'django.contrib.sessions.middleware.SessionMiddleware',
   
)

TEMPLATE_CONTEXT_PROCESSORS = (
...
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.request"
)

INSTALLED_APPS = (
...
    'django.contrib.sessions',
   
)


This is a simple view

def index(request):
    menu = getMainMenu()
    collections = Collection.objects.all().order_by('sortOrder')
    number_of_pictures = Picture.objects.count()
    request.session['cart'] = 'YES!'
    return render_to_response('index.html',{'menu':menu,
                                            'collections':collections,
                                            
'number_of_pictures':number_of_pictures},
                                            
context_instance=RequestContext(request))

and bit of template:

{% if settings.DEBUG == True %}
                        <p>Debug data:
                        <nobr><br>Session key: {{ 
request.session.session_key }}</nobr> 
                        <br>Session cart: {{ request.session.cart }}
                        </p>
                        {% endif %}

however, when I hit /index view and refresh it:

the session_key is always new
no cookie saved on browser's end
session cart always empty.

anyway I can debug things to figure what's wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to