Sunday, April 5, 2009

Sessions lost

Hello, sorry for my english, I'm french.

I have a god damn problem with sessions of cakephp : they don't work !
When I flash to another controller/action, everything is lost. I went
into the core.php file and lowered everything possible and tried all
the session handlers :

Configure::write('Session.checkAgent', false);
Configure::write('Security.level', 'low');

etc.

But it doesnt work. I already read many discussions about this problem
but I couldnt solve it. This is a simple example of what I want to
do :

CODE

<?php

class UsersController extends AppController
{
function login()
{
if (!empty($this->data))
{
$userId = $this->User->loginVerif($this->data);
if ($userId != null)
{
$this->Session->write('Login.id', $userId);
print_r($_SESSION);//Works fine
$this->flash("Vous vous êtes authentifié avec succès.", "/
quizzes/jouer");
}
}
}
}
?>


And the controller called by the previous action :

CODE

<?php

class QuizzesController extends AppController
{
function jouer()
{
echo $this->Session->read('Login.id');//Totally empty !
$quiz = $this->Quiz->details();
$this->set('quiz', $quiz);
}
}
?>


I know that there's already an authcomponent, but it doesnt work, for
the same reasons I guess.

Thanks for all in advance !

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