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