Alfredo,

I'm using ACL/Auth and I do not seem to have this problem. After the
session timed out, when I tried to access any restricted places, I was
redirected to the login page. Don't know if my using ACL has anything
to do with it.

BTW how do you tell if your session has expired? In my case, I was
redirected to the login page.

Steve



On Feb 20, 1:13 pm, lawwton <[email protected]> wrote:
> Is this too hard of a question? Am I the only one running into this or
> this is something normal, expected behavior ? Because if it is then
> there is something wrong with Auth. Again I am thinking I am missing
> something, not assuming that there is a bug or anything like that.
>
> I just need to know so I can take the appropriate actions on my side
> (read the core code to see what is doing, create necessary hack to
> correct it, submit patch, fix it or whatever is needed)
>
> This is my third post asking for the same thing with no response, this
> should be fairly trivial if you ask me in a framework.
>
> Thanks in advance,
>
> Alfredo
>
> On Feb 19, 10:26 pm, lawwton <[email protected]> wrote:
>
> > Any ideas regarding this?
>
> > How can I ensure that after I am logged in if the session expires the
> > user is re-directed back to the login page for any new requests coming
> > in?
>
> > By the way, I could probably hack my way around this with a couple of
> > lines of code in my AppController. I am trying to understand why Auth
> > is just not simply re-directing after the session expires. Auth does
> > the right thing if I am not logged in, I get re-directed or sent to
> > the login page in my case. The question is why not when the session
> > expires. I am assuming I am missing something.
>
> > Thanks in advance,
>
> > Alfredo
>
> > On Feb 18, 1:38 pm, Alfredo Quiroga-Villamil <[email protected]>
> > wrote:
>
> > > I am sure there is a way to get this done, just not sure if I am
> > > missing something. Further details below:
>
> > > Issue:
> > > =========
>
> > > Need to re-direct after session has expired or cleared.
>
> > > Description:
> > > =========
>
> > > I am currently only using the Auth component to handle my
> > > authentication. No ACL for now. In my AppController I have:
>
> > > =====================================================================
> > >         public function beforeFilter() {
> > >                 parent::beforeFilter();
> > >                 $this->Auth->loginAction = array('controller' => 
> > > 'portal', 'action'
> > > => 'login');
> > >                 $this->Auth->loginRedirect = array('controller' => 
> > > 'portal',
> > > 'action' => 'main');
> > >                 $this->Auth->logoutRedirect = array('controller' => 
> > > 'portal',
> > > 'action' => 'index');
> > >                 $this->Auth->autoRedirect = false;
> > >         } // End of beforeFilter()
> > > =====================================================================
>
> > > Everything works great. The only issue I currently have is the following:
>
> > > After the session expire, I am not being re-directed or kicked out of
> > > the main view.
>
> > > I am only using cakephp as my backend engine. All my front end is
> > > built using something else and all I do is send ajax requets. I've
> > > also looked at the property ajaxLogin under Auth; but after further
> > > inspection of the code to try to understand what it does I found the
> > > part in auth.php where I think it's being called. See below:
>
> > > auth.php from cakephp
>
> > > =====================================================================
> > >                 } else {
> > >                         if (!$this->user()) {
> > >                                 if (!$this->RequestHandler->isAjax()) {
> > >                                         
> > > $this->Session->setFlash($this->authError, 'default', array(), 'auth');
> > >                                         
> > > $this->Session->write('Auth.redirect', $url);
> > >                                         
> > > $controller->redirect($loginAction, null, true);
> > >                                         return false;
> > >                                 } elseif (!empty($this->ajaxLogin)) {
> > >                                         $controller->viewPath = 
> > > 'elements';
> > >                                         echo 
> > > $controller->render($this->ajaxLogin, 'ajax');
> > >                                         $this->_stop();
> > >                                         return false;
> > >                                 }
> > >                         }
> > >                 }
> > > =====================================================================
>
> > > There are no re-directs there, it's rendering as the property
> > > documentation describes.
>
> > > How can I ensure that after I am logged in if the session expires the
> > > user is re-directed back to the login page for any request coming in.?
>
> > > Thanks in advance,
>
> > > Alfredo
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to