Hi
I have my CAKEPHP application ... I have create a demo user and an
action in users controller called "demo" to allow access like demo
user:
function demo {
$this->Auth->logout();
$this->data[$this->Auth->fields['username']] = 'demo';
$this->data[$this->Auth->fields['password']] = $this->Auth-
>password('demo');
if (!($this->Auth->login($data))) {
$this->redirect($this->Auth->loginAction);
} else {
$this->Session->delete('Auth.redirect');
//print_r($this->Session->read('Auth.User.username'));die();
$this->Auth->loginRedirect = array('admin' =>
false,'controller' =>
'demo', 'action' => 'index');
}
}
Now in a page of another site I have add a link that redirect to /
users/demo of my cake application.
But If I click on this link I don't login in cakephp application and I
redirect to login page instead that on /demo/index
But If i uncomment the line print_r($this->Session-
>read('Auth.User.username'));die(); and the I reclick on link I can
see that it show the correct username "demo".
Can someone help me about this problem?
Many Thanks
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php