cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Joseph <pjos...@gmail.com>
Subject Re: best way to show login page when session expires? (Javascript/Java based Cocoon app.)
Date Thu, 19 May 2011 12:10:28 GMT
You are correct--I will go this route--I now realize that it is the 
right thing to do!

On 5/19/2011 6:57 AM, Andre Juffer wrote:
> On 19/05/11 13:38, Paul Joseph wrote:
>> HI Thorsten,
>>
>> Thank you much for your two suggestions.  I will proceed with your 
>> second course as it is very easy to do that given the way the app is 
>> written.
>
> Just like to add that the Auth approach basically works in the same 
> way. An action is available that will test whether or not a session is 
> expired. Everything is already written, and there is not much that you 
> need to do yourself (besides modifying the sitemap).
>
>>
>> best.
>> Paul
>>
>> On 5/19/2011 6:20 AM, Thorsten Scherler wrote:
>>> On Wed, 2011-05-18 at 10:45 -0400, Paul Joseph wrote:
>>>> Hi there,
>>>>
>>>> I have a Cocoon app that has numerous pages...I use Javascript
>>>> (flowscript) to do the display and Java to do the "business logic."
>>>>
>>>> In the Java layer, I have code to detect when the session expires and
>>>> this works nicely and so I am able to maintain a count of currently
>>>> logged in users.
>>>>
>>>> Here is my request:  A customer asked that when their session expires,
>>>> that they be shown the login page automatically.
>>>>
>>>> Now I know when the session expires, but how do I show the Login page
>>>> from within Java code?  They could be anywhere in the app so I 
>>>> presume I
>>>> should directly have the Java code somehow display the Login page?
>>>>
>>>> Pointers much appreciated.
>>> I reckon all pages are going through an action which test, whether the
>>> user is logged in, correct? If not how to you test whether the user is
>>> logged in and has the authority to see the page?
>>>
>>> The simplest I guess is to write your own action extending e.g.
>>> http://cocoon.apache.org/2.1/userdocs/optional/session-action.html 
>>> where
>>> you test for the session.
>>>
>>> You can use something like the following in your sitemap:
>>> <map:act type="session">
>>> <!-- session exists go on with generating USER page -->
>>> </map:act>
>>> <!-- session failed show login page-->
>>>
>>> Another route is to test it in your existing flow script and redirect
>>> from within that flow to the login page.
>>>
>>> if (YourJavaClass.validateSession(session)){
>>>   // session exists go on with generating USER page
>>> }else{
>>>   // session failed show login page
>>> }
>>>
>>> However that depends on your usecase which makes more sense.
>>>
>>> salu2
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message