I am in need of a bit of assistance.

 

User has logged in  then for some reason session has expired and they click
on a link that will now return what would be

 

$this->Auth->ajaxLogin = '/elements/expired_session';

 

all fine and dandy unless the link was ajax and the response should be JSON
then nothing gets returned.

 

So I need to put something like

 

if ( $this->RequestHandler->isAjax() ) {

 


                //make it return JSON   

//$this->_ajaxReturn( $response );         my own custom JSON response
function works everywhere on the site so its not this

} else {

 

$this->Auth->ajaxLogin = '/elements/expired_session';

 

}

 

I tried adding just that to  app_controller function beforeFilter() and also
in function isAuthorized() but all I get back is the html
$this->Auth->ajaxLogin straight HTML, never JSON

 

Where should this code go? beforeFunction what? Have the JS pull the expired
session element? (Thinking now this might be best since the response can be
HTML, JSON or a straight redirect to login depending on what the user was
trying to do at the moment of error)

 

And ideas or suggestions?

 

Thanks,

 

Dave

 

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

Reply via email to