What would be the best way to modify the $this->Auth->ajaxLogin =
'/elements/users/expired_login';
Since all my ajax calls return JSON with a status true or false along with
the element.
if I login, delete my session and then make an ajax call I see the server
response of the elements/users/expired_login but nothing shows because my js
is looking for true / false status in the JSON response.
I have tried a few things like
App_controller beforeFilter
if ( $this->RequestHandler->isAjax() && !$this->Session->valid()) {
$response = array(
'status' => false,
'message' => 'not logged in test message .');
$this->header( 'Content-Type:
application/json' );
echo json_encode( $response );
exit();
} else {
$this->Auth->ajaxLogin = '/elements/users/expired_login';
}
But it seems to always get stuck on the else{} part and attempt to return
the ajaxLogin element.
Any ideas?
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" 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