Hi Devraj,

thanks for your answer.
I try to explain better my problem.

I have a controller "popups_controller.php":

class PopupsController extends AppController {
        var $uses = null;
        var $helpers = array('Html', 'Form');

        function info_popup($id_sound) {
            // I created a new layout beacause I don't want the title of the 
default layout in my popup
            $this->layout = 'popup';
            $this->set('sound', $this->requestAction('/des_points/view/'.
$id_sound));
        }
}

and I have a view "info_pop.thtml" where I wrote the following code 
line:

<a href="javascript:go_to('<?php echo $session->read('id_user');?>', 
'<?php echo '/des_comments/add/'.$sound['DesPoint']['id']; ?>')">Add 
comment</a>

The go_to function redirect the user to the registration page if he 
has not already made the login, otherwise it allows the user to add a 
comment.
I check the variable id_user and I make the control above.
The problem is that if I put directly in the browser the link to that 
view "mysite/info_popup/1" the control works beacause the session 
variable is filled with the id of the current user.
Instead, when I click on the interested object and a popup appears, 
the popup is filled by the correct page (the view "info_popup.thtml") 
with the correct information about the selected object, but the 
session variable is empty.
I think that making an xmlHttpRequest (made in a javascript to request 
the page and fill the popup) a new session starts and so the variable 
with the id of the current user is cleaned.

Iif you have already solved this problem, could you send me any sample 
code?
Many thanks!
Francesca


On Jan 27, 4:04 am, "Devraj Mukherjee" <[EMAIL PROTECTED]> wrote:
> If page.php is part of your controllers then you should be able to
> check this very quickly. Let me know if this is the case and I can
> send you some sample code.
>
> On 1/27/07, Ilafra <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi ya!
>
> > I have a cake application and I have some markers where user can click
> > and a popup appears. The popup is drawn through a javascript and filled
> > by a page.php coming from an xmlHttpRequest.
> > In this popup I have to allow user to add a comment (linked to the
> > marker) only if he/she has made the login. I would like to check the
> > session variable where I stored the user id (after his/her login).
> > But in the popup the session variable is not available because  it is
> > empty and probably a new session starts!
> > How can I manage this situation and see everywhere (also in the popup)
> > my variable?
>
> > Thanks a lot!
> > Francesca--
> "I never look back darling, it distracts from the now", Edna Mode (The
> Incredibles)


--~--~---------~--~----~------------~-------~--~----~
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