Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#7264 closed (worksforme)

Cookies not be set for IE6, IE7 and Safari.

Reported by: Seth Buntin Owned by: nobody
Component: contrib.sessions Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When using session variables the corresponding session cookies aren't being set in IE6, 7 and Safari when application is on production server. This doesn't happen when the application is ran from the Django development server. I have tried setting SESSION_COOKIE_DOMAIN and that didn't work and now I am butting my head to figure out what is going on. Firefox works on production server just fine.

I have running Ubuntu 7.10 with Apache 2.2 and mod_wsgi 1.3 if that helps any. I do not have PHP enabled. At this point I am willing to share any of my code to figure this out. The Admin doesn't work and I have a piece of code that gets or sets a session id for a cart if it exists. I do this when adding items to the cart or displaying the cart in any way. Adding and item to the cart works just fine but when trying to go to the cart page and displaying that same cart I get an empty cart. Here is my get cart method.

    @classmethod
    def get_session_cart(cls, request, customer=None):
        try:
            cart = cls.objects.get(pk=request.session.get('cart', ''))
        except Cart.DoesNotExist:
            cart = cls()
            cart.customer = customer
            cart.save()
            request.session['cart'] = cart.id
        return cart

So the session cookies aren't being saved and Django creates a new session every time I run this method.

Change History (3)

comment:1 by James Bennett, 16 years ago

Resolution: worksforme
Status: newclosed

If the cookie mechanism really didn't work in these browsers, we'd be flooded with huge numbers of bug reports, so it must be something about your setup. This isn't really the place for questions about that, though, so head over to the django-users mailing list.

comment:2 by Jarek Zgoda, 16 years ago

My best guess, there is something related to cross-domain cookies. I saw this problem with my app in IE6 (it sets a cookie for *.domain, then tries to read it in subdomain.domain). This problem suddenly vanishes and reappears and I am unable to detect the reason for this weird behaviour.
I second ubernostrum in closing this ticket, as this is hardly reproductible under any circumstances (at least I was unable to trace it).

comment:3 by Seth Buntin, 16 years ago

Just so everyone knows, this wasn't a Django problem. It was because I had a underscore ("_") in my sub-domain. Thanks ubernostrum for pointing me away from Django otherwise I would have never figured it out.

Note: See TracTickets for help on using tickets.
Back to Top