I'll check the Firebug later today, I'm not home right now. I did notice
cookies being present in the response headers, but I can't remember the
request headers. I'm using jQuery library without any plugins.

The request is going to the same domain of course, otherwise you'd get a
bunch of security headers.

But aren't cookies sent with Ajax queries by default? I've used Ajax
requests to update several things in previous projects, all of which needed
the user to be authenticated. The only thing new here is that I'm writing
data to the session.

- Arjen

On 9/24/07, Grant Cox <[EMAIL PROTECTED]> wrote:
>
>
> So it's like the Ajax request just isn't submitting the cake session
> cookie?  Install something that can show you the headers of your Ajax
> request to see if that is the case (FireBug for Firefox can do this,
> or Charles can for any browser).  If your Ajax request is not
> submitting the session cookie, there is nothing you can do about it on
> the Cake side (other than making sure the Ajax request has the session
> cookie directly in the requested URL).
>
> Is the Ajax request going to the same domain / subdomain as the main
> site?  What Ajax library are you using?
>
>
> On Sep 24, 2:06 am, "Arjen V" <[EMAIL PROTECTED]> wrote:
> > Hi fellow Cakers,
> >
> > I just finished Ajax-ifying my image battle hobby project. Two images
> are
> > shown and the user is asked to select the best/most beautiful/etc. one.
> Two
> > session variables are kept with the ID numbers of the images that are to
> be
> > judged, to prevent cheating / multiple accidental clicks.
> >
> > However, when writing to session variables in the '/images/battle'
> function
> > when it's called by an Ajax request (to store the ID numbers of the next
> set
> > of images), CakePHP starts a new session. It doesn't destroy the old
> one,
> > but all previous data is lost (of course).
> >
> > I've tried switching session storage mechanisms. I'm using 'database',
> but
> > it also happens in 'cake' and 'php' mode. I've also set the security to
> > 'low'.
> >
> > I found some similar cases in the past,
> withhttps://trac.cakephp.org/ticket/3238as the most recent. I've patched my
> > session.php with the provided diff (since I'm already using a SVN
> checkout)
> > and set CAKE_SESSION_SECURE_USER_AGENT to false, but to no avail. I'm
> still
> > not sure if it's the same: that bug is about sessions being invalidated,
> but
> > I'm not seeing that happening here after some debugging in session.php.
> It's
> > as if Cake doesn't know a session has been opened already.
> >
> > If this is a bug, I'll report it in Trac. But I'd like to be sure before
> I
> > do. Has anyone else experienced this?
> >
> > Greetings,
> > Arjen
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to