Steve:

Thanks for the response. That should be the right behavior. In my case
it's not doing that which is the reason why I am thinking I am missing
something or have something wrong somewhere. I've posted code in my
previous posts to see if there is something that I am missing. I've
read the API and looked for possible areas, properties that I might
have not set, however at first glance everything I have seems to be
correct.

When my session expires though, after a new request hits the
application I don't get re-directed to the login page like it does for
example when I am not logged in and I try to access that same URL.

Would you mind posting the code you have in your AppController so I
can take a look?

Thanks in advance for the help,

Alfredo

On Fri, Feb 20, 2009 at 6:27 PM, stevel <[email protected]> wrote:
>
> 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