The problem, isn't actually a problem is just the way Ajax works.
By default an ajax request don't send the session data to the server, that's the way ajax works.
In any development with cake or not an ajax request is sessionless, it's just an extra request sending pieces of data to the server and getting the results of that, no more no less.
Therefore if you need any session data to be sent to the server you need to send it in the request data either via GET or POST and than on server side process it.
To send session data you need to send the session header, that's another option. You need to insert the session data into the request via the Javascript function 'setRequestHeader'.
I'm sending you a AJAX request class that I made where you can see the manipulation of the request header. Insert your session data there, although I'm not sending session data there but I think you can modify it in order to achieve you goal.
I hope it helps you
Joao
On Tue, Mar 3, 2009 at 9:31 PM, Sidney <AussieAlThompson@gmail.com> wrote:
Try changing your security level to medium from high. That worked for
me and many others. Ajax and sessions are a common problem.
On Mar 3, 5:43 am, jc_mich <juan.mich...@paasel.com> wrote:
> Hi
>
> I'm trying to render an element after an ajax request. After the request is
> successfully accepted by the controller the session will be destroyed.
>
> Is there anyone who had the same problem?
>
> Thanks!
> --
> View this message in context:http://www.nabble.com/Ajax-requests-destroy-sessions-tp22294048p22294...
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment