Jon:

Yeah, that's the issue I currently have. If I was only making one ajax
request here and there it would be fine. A callback would work. In
fact, the ajaxLogin property in Auth is quite convenient, since it'll
allows us to render an element if the session has expired and a new
ajax request comes in. We could return json with say a propery of
success set to false alonng with the corresponding description. I've
tested this and it works as expected.

However my entire UI is built using javascript and all the actions in
the UI invoke ajax requests. This makes analyzing or creating
callbacks for everyone of these cases cumbersome.

The way to go here seems to be using a Comet approach also known as
server-push, reverse ajax, ajax push and others. I am taking my time
reading and trying to see how to best implement this for my
environment.

Once I have an implemented solution I will post it here. For now in
the short term I've extended my session time a little bit.

Let me know what you find or how you decide to go about this. Quite an
interesting problem and it'll be around for a while I guess since we
all tend to use ajax more and more these days.

Thanks in advance,

Alfredo

On Sat, Feb 21, 2009 at 8:52 PM, Jon <[email protected]> wrote:
>
> I'm having the same problem and I'm curious what solution you come up
> with. I haven't taken the time to play around with it yet but am
> wondering if you can just make the AJAX pages return some specific
> text that will indicate that you're logged out. Then maybe you can
> have an AJAX callback analyze the response and redirect if necessary.
> That seems a little hackish so I'm wondering if there's a better way.
>
> Thanks,
> Jon
>
> On Feb 20, 6:26 pm, Alfredo Quiroga-Villamil <[email protected]>
> wrote:
>> Thanks Miles.
>>
>> I finally had a little bit of time to devote to this and brainstorm
>> for a few minutes. The issue is a bit more involved than what I had
>> originally thought. I didn't throughly think about my environment and
>> current implementation. All my requests are being sent via ajax. This
>> changes the game a little.
>>
>> There is a parameter in AppController that allows me to render an
>> element if the session has expired for an ajax request.
>>
>> I am currently exploring and thinking about a clean solution to handle
>> the re-direct on th client side since ajax is the issue here. If
>> anyone has ran into this before and has come up with a clean solution
>> please feel free to suggest it.
>>
>> Thanks in advance,
>>
>> Alfredo
>>
>> On Fri, Feb 20, 2009 at 9:20 PM, Miles J <[email protected]> wrote:
>>
>> > I have autoRedirect disabled as well but my redirect works fine. Make
>> > sure your allow() in each controller isn't allowing those pages to be
>> > viewed.
>
> >
>

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