Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent session from expiration?

2010-03-16 Thread Daniel Peters

Martin Asenov wrote:


In my webapp it looks like the session never expires, although I've set timeout 
of 30 seconds. But I have a digital
clock in my right lower corner of the screen, that has an 
AjaxSelfUpdatingBehavior activated on it. Does it simulate
user actions, that may cause session not to expiry?

As other people already wrote, this keeps your session alive.
I dont know what kind of "clock" you have on your page, but you should consider to update it with plain Javascript 
client-side.

If you want it to show the server-time, initialize it one time and let JS 
increase it each second with a timer.

regards
Daniel

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Does AjaxSelfUpdatingBehavior simulate user actions and prevent session from expiration?

2010-03-16 Thread Martin Asenov
Thanks, Michael!

But how could I know if the user hasn't done anything? Does it have something 
to do with the RequestCycle? 

Regards,
Martin

-Original Message-
From: Michael O'Cleirigh [mailto:michael.ocleir...@rivulet.ca] 
Sent: Tuesday, March 16, 2010 5:45 PM
To: users@wicket.apache.org
Subject: Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent 
session from expiration?

Hi Martin,

AjaxSelfUpdatingTimerBehavior has an method called 
onPostProcessTarget(...); its is called each time the ajax request hits 
the server side.

You will want to add your timeout detection here.

You don't need to turn off the behavior.  You can just invalidate the 
session directly like:

class ExpiringAjaxTimerBehavior extends AjaxSelfUpdatingTimerBehaviour {

protected void onPostProcessTarget(final AjaxRequestTarget target)
 {

 if (userHasntDoneAnyThingLimitReached) {
 this.stop();
 Session.get().invalidate();
 }
 }

}

This way if the timer is active it can leverage application state to 
determine when to expire and if its not running the standard expiry will 
take place.

Regards,

Mike



> My idea is to disable the ajaxselfupdatingtimerbehavior if the user hasn't do 
> anything for 15 mins for instance... and set session timeout to another 15, 
> so that the session really lasts 30 mins. But I'm just wondering how to do 
> that exactly... Any ideas?
>
> Best,
> Martin
>
> -Original Message-
> From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Sent: Tuesday, March 16, 2010 4:08 PM
> To: users@wicket.apache.org
> Subject: Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent 
> session from expiration?
>
> Maybe you can disable your "clock" if the user haven´t performed any other
> activity for a while... That way session will expire...
>
> Ernesto
>
> On Tue, Mar 16, 2010 at 2:46 PM, Martin Asenov  wrote:
>
>
>> And why is that? Shouldn't Wicket session filter such events and not
>> consider them user interaction with the system?
>>
>> Thank you both for the replies, and for the link also! Great help!
>>
>> Regards,
>> Martin
>>
>> -Original Message-----
>> From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
>> Sent: Tuesday, March 16, 2010 3:39 PM
>> To: users@wicket.apache.org
>> Subject: Re: Does AjaxSelfUpdatingBehavior simulate user actions and
>> prevent session from expiration?
>>
>> yes. Ajax contacts the server. And on each request the timer are reset.
>>
>> So your ajax behavior are also functioning as a heartbeat or keepalive
>> feature.
>>
>> 2010/3/16 Martin Asenov
>>
>>  
>>> Hello, everyone!
>>>
>>> In my webapp it looks like the session never expires, although I've set
>>> timeout of 30 seconds. But I have a digital clock in my right lower
>>>
>> corner
>>  
>>> of the screen, that has an AjaxSelfUpdatingBehavior activated on it. Does
>>>
>> it
>>  
>>> simulate user actions, that may cause session not to expiry?
>>>
>>> Thank you,
>>> Martin
>>>
>>>
>>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>>  
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent session from expiration?

2010-03-16 Thread Michael O'Cleirigh

Hi Martin,

AjaxSelfUpdatingTimerBehavior has an method called 
onPostProcessTarget(...); its is called each time the ajax request hits 
the server side.


You will want to add your timeout detection here.

You don't need to turn off the behavior.  You can just invalidate the 
session directly like:


class ExpiringAjaxTimerBehavior extends AjaxSelfUpdatingTimerBehaviour {

protected void onPostProcessTarget(final AjaxRequestTarget target)
{

if (userHasntDoneAnyThingLimitReached) {
this.stop();
Session.get().invalidate();
}
}

}

This way if the timer is active it can leverage application state to 
determine when to expire and if its not running the standard expiry will 
take place.


Regards,

Mike




My idea is to disable the ajaxselfupdatingtimerbehavior if the user hasn't do 
anything for 15 mins for instance... and set session timeout to another 15, so 
that the session really lasts 30 mins. But I'm just wondering how to do that 
exactly... Any ideas?

Best,
Martin

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
Sent: Tuesday, March 16, 2010 4:08 PM
To: users@wicket.apache.org
Subject: Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent 
session from expiration?

Maybe you can disable your "clock" if the user haven´t performed any other
activity for a while... That way session will expire...

Ernesto

On Tue, Mar 16, 2010 at 2:46 PM, Martin Asenov  wrote:

   

And why is that? Shouldn't Wicket session filter such events and not
consider them user interaction with the system?

Thank you both for the replies, and for the link also! Great help!

Regards,
Martin

-Original Message-
From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
Sent: Tuesday, March 16, 2010 3:39 PM
To: users@wicket.apache.org
Subject: Re: Does AjaxSelfUpdatingBehavior simulate user actions and
prevent session from expiration?

yes. Ajax contacts the server. And on each request the timer are reset.

So your ajax behavior are also functioning as a heartbeat or keepalive
feature.

2010/3/16 Martin Asenov

 

Hello, everyone!

In my webapp it looks like the session never expires, although I've set
timeout of 30 seconds. But I have a digital clock in my right lower
   

corner
 

of the screen, that has an AjaxSelfUpdatingBehavior activated on it. Does
   

it
 

simulate user actions, that may cause session not to expiry?

Thank you,
Martin


   

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org


 

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

   



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Does AjaxSelfUpdatingBehavior simulate user actions and prevent session from expiration?

2010-03-16 Thread Martin Asenov
My idea is to disable the ajaxselfupdatingtimerbehavior if the user hasn't do 
anything for 15 mins for instance... and set session timeout to another 15, so 
that the session really lasts 30 mins. But I'm just wondering how to do that 
exactly... Any ideas?

Best,
Martin

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Tuesday, March 16, 2010 4:08 PM
To: users@wicket.apache.org
Subject: Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent 
session from expiration?

Maybe you can disable your "clock" if the user haven´t performed any other
activity for a while... That way session will expire...

Ernesto

On Tue, Mar 16, 2010 at 2:46 PM, Martin Asenov  wrote:

> And why is that? Shouldn't Wicket session filter such events and not
> consider them user interaction with the system?
>
> Thank you both for the replies, and for the link also! Great help!
>
> Regards,
> Martin
>
> -Original Message-
> From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
> Sent: Tuesday, March 16, 2010 3:39 PM
> To: users@wicket.apache.org
> Subject: Re: Does AjaxSelfUpdatingBehavior simulate user actions and
> prevent session from expiration?
>
> yes. Ajax contacts the server. And on each request the timer are reset.
>
> So your ajax behavior are also functioning as a heartbeat or keepalive
> feature.
>
> 2010/3/16 Martin Asenov 
>
> > Hello, everyone!
> >
> > In my webapp it looks like the session never expires, although I've set
> > timeout of 30 seconds. But I have a digital clock in my right lower
> corner
> > of the screen, that has an AjaxSelfUpdatingBehavior activated on it. Does
> it
> > simulate user actions, that may cause session not to expiry?
> >
> > Thank you,
> > Martin
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent session from expiration?

2010-03-16 Thread Ernesto Reinaldo Barreiro
Maybe you can disable your "clock" if the user haven´t performed any other
activity for a while... That way session will expire...

Ernesto

On Tue, Mar 16, 2010 at 2:46 PM, Martin Asenov  wrote:

> And why is that? Shouldn't Wicket session filter such events and not
> consider them user interaction with the system?
>
> Thank you both for the replies, and for the link also! Great help!
>
> Regards,
> Martin
>
> -Original Message-
> From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
> Sent: Tuesday, March 16, 2010 3:39 PM
> To: users@wicket.apache.org
> Subject: Re: Does AjaxSelfUpdatingBehavior simulate user actions and
> prevent session from expiration?
>
> yes. Ajax contacts the server. And on each request the timer are reset.
>
> So your ajax behavior are also functioning as a heartbeat or keepalive
> feature.
>
> 2010/3/16 Martin Asenov 
>
> > Hello, everyone!
> >
> > In my webapp it looks like the session never expires, although I've set
> > timeout of 30 seconds. But I have a digital clock in my right lower
> corner
> > of the screen, that has an AjaxSelfUpdatingBehavior activated on it. Does
> it
> > simulate user actions, that may cause session not to expiry?
> >
> > Thank you,
> > Martin
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent session from expiration?

2010-03-16 Thread Jonas
It's the servlet container that manages the HttpSessions. The servlet container
cannot distinguish between 'real' user requests and ajax events -
they're all plain
http requests concerning a certain session.
So, I don't think there's anything wicket could do about this...

cheers,
Jonas

On Tue, Mar 16, 2010 at 2:46 PM, Martin Asenov  wrote:
> And why is that? Shouldn't Wicket session filter such events and not consider 
> them user interaction with the system?
>
> Thank you both for the replies, and for the link also! Great help!
>
> Regards,
> Martin
>
> -Original Message-
> From: nino martinez wael [mailto:nino.martinez.w...@gmail.com]
> Sent: Tuesday, March 16, 2010 3:39 PM
> To: users@wicket.apache.org
> Subject: Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent 
> session from expiration?
>
> yes. Ajax contacts the server. And on each request the timer are reset.
>
> So your ajax behavior are also functioning as a heartbeat or keepalive
> feature.
>
> 2010/3/16 Martin Asenov 
>
>> Hello, everyone!
>>
>> In my webapp it looks like the session never expires, although I've set
>> timeout of 30 seconds. But I have a digital clock in my right lower corner
>> of the screen, that has an AjaxSelfUpdatingBehavior activated on it. Does it
>> simulate user actions, that may cause session not to expiry?
>>
>> Thank you,
>> Martin
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: Does AjaxSelfUpdatingBehavior simulate user actions and prevent session from expiration?

2010-03-16 Thread Martin Asenov
And why is that? Shouldn't Wicket session filter such events and not consider 
them user interaction with the system?

Thank you both for the replies, and for the link also! Great help!

Regards,
Martin 

-Original Message-
From: nino martinez wael [mailto:nino.martinez.w...@gmail.com] 
Sent: Tuesday, March 16, 2010 3:39 PM
To: users@wicket.apache.org
Subject: Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent 
session from expiration?

yes. Ajax contacts the server. And on each request the timer are reset.

So your ajax behavior are also functioning as a heartbeat or keepalive
feature.

2010/3/16 Martin Asenov 

> Hello, everyone!
>
> In my webapp it looks like the session never expires, although I've set
> timeout of 30 seconds. But I have a digital clock in my right lower corner
> of the screen, that has an AjaxSelfUpdatingBehavior activated on it. Does it
> simulate user actions, that may cause session not to expiry?
>
> Thank you,
> Martin
>
>

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent session from expiration?

2010-03-16 Thread Ernesto Reinaldo Barreiro
http://chillenious.wordpress.com/2007/06/19/how-to-create-a-text-area-with-a-heart-beat-with-wicket/


On Tue, Mar 16, 2010 at 2:27 PM, Martin Asenov  wrote:

> Hello, everyone!
>
> In my webapp it looks like the session never expires, although I've set
> timeout of 30 seconds. But I have a digital clock in my right lower corner
> of the screen, that has an AjaxSelfUpdatingBehavior activated on it. Does it
> simulate user actions, that may cause session not to expiry?
>
> Thank you,
> Martin
>
>


Re: Does AjaxSelfUpdatingBehavior simulate user actions and prevent session from expiration?

2010-03-16 Thread nino martinez wael
yes. Ajax contacts the server. And on each request the timer are reset.

So your ajax behavior are also functioning as a heartbeat or keepalive
feature.

2010/3/16 Martin Asenov 

> Hello, everyone!
>
> In my webapp it looks like the session never expires, although I've set
> timeout of 30 seconds. But I have a digital clock in my right lower corner
> of the screen, that has an AjaxSelfUpdatingBehavior activated on it. Does it
> simulate user actions, that may cause session not to expiry?
>
> Thank you,
> Martin
>
>