RenewSession State Before Expiration In .Net 1.1
RenewSession State Before Expiration In .Net 1.1
am 15.01.2008 21:41:04 von WhiskeyRomeo
The below appears to be a partial answer to my problem but I don't to keep
sessions alive simply because a user has wondered off to do something else.
Session timeout is set to the standard 30 minutes.
KEEPALIVE.aspx has:
private void Page_Load(object sender, System.EventArgs e)
{
Response.AddHeader("Refresh",8000);
}
MyRegPage.aspx has:
frameBorder=no width=0 height=0 runat="server">
I am not a JavaScript programmer but have some very basic skills, how can I
use this solution but add an alert button that pops up at the 17 minute mark
and if they click Ok the KeepAlive.aspx refreshes. If there is no response
(by the 20 minute mark) the alert box goes away and is replaced by one that
says "Your Session has timed out. Go to . . ."
wr
Re: RenewSession State Before Expiration In .Net 1.1
am 17.01.2008 02:15:57 von Alvin Bruney
No, that's not a good approach. Think security, I open several hundred
connections and now since you allow me to keep those active sessions open,
I'll eventually cause your server to run out of memory. If the user walks
away, the session should time out otherwise, they need to be at the
computer - this long standing design makes sense for a number of different
reasons and you should stick to it. Having said that, I've done this as well
but set the app pool to recycle at midnight to 'somewhat' mitigate the
resource threat. I hope my rambling makes sense to you.
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"WhiskeyRomeo" wrote in message
news:6AE33E51-5317-4C0E-BF8D-7D123FEC9749@microsoft.com...
> The below appears to be a partial answer to my problem but I don't to keep
> sessions alive simply because a user has wondered off to do something
> else.
> Session timeout is set to the standard 30 minutes.
>
> KEEPALIVE.aspx has:
> private void Page_Load(object sender, System.EventArgs e)
> {
> Response.AddHeader("Refresh",8000);
> }
> MyRegPage.aspx has:
>
> frameBorder=no width=0 height=0 runat="server">
>
> I am not a JavaScript programmer but have some very basic skills, how can
> I
> use this solution but add an alert button that pops up at the 17 minute
> mark
> and if they click Ok the KeepAlive.aspx refreshes. If there is no
> response
> (by the 20 minute mark) the alert box goes away and is replaced by one
> that
> says "Your Session has timed out. Go to . . ."
>
> wr
Re: RenewSession State Before Expiration In .Net 1.1
am 17.01.2008 05:11:00 von WhiskeyRomeo
Yes, thanks for replying -- I know it is a bad approach hence the question
how can I use JavaScript to control it?
WR
"Alvin Bruney [ASP.NET MVP]" wrote:
> No, that's not a good approach. Think security, I open several hundred
> connections and now since you allow me to keep those active sessions open,
> I'll eventually cause your server to run out of memory. If the user walks
> away, the session should time out otherwise, they need to be at the
> computer - this long standing design makes sense for a number of different
> reasons and you should stick to it. Having said that, I've done this as well
> but set the app pool to recycle at midnight to 'somewhat' mitigate the
> resource threat. I hope my rambling makes sense to you.
>
> --
>
> Regards,
> Alvin Bruney [MVP ASP.NET]
>
> [Shameless Author plug]
> The O.W.C. Black Book, 2nd Edition
> Exclusively on www.lulu.com/owc $19.99
> -------------------------------------------------------
>
>
>
> "WhiskeyRomeo" wrote in message
> news:6AE33E51-5317-4C0E-BF8D-7D123FEC9749@microsoft.com...
> > The below appears to be a partial answer to my problem but I don't to keep
> > sessions alive simply because a user has wondered off to do something
> > else.
> > Session timeout is set to the standard 30 minutes.
> >
> > KEEPALIVE.aspx has:
> > private void Page_Load(object sender, System.EventArgs e)
> > {
> > Response.AddHeader("Refresh",8000);
> > }
> > MyRegPage.aspx has:
> >
> > frameBorder=no width=0 height=0 runat="server">
> >
> > I am not a JavaScript programmer but have some very basic skills, how can
> > I
> > use this solution but add an alert button that pops up at the 17 minute
> > mark
> > and if they click Ok the KeepAlive.aspx refreshes. If there is no
> > response
> > (by the 20 minute mark) the alert box goes away and is replaced by one
> > that
> > says "Your Session has timed out. Go to . . ."
> >
> > wr
>
Re: RenewSession State Before Expiration In .Net 1.1
am 18.01.2008 00:59:06 von Alvin Bruney
I had code for this but I can't find it. Here's how I remember doing it.
Create a function that pops a message box. Capture the return value from the
message box click. Let's call that function A. Map your mouse move events to
another function, let's call that function B. Inside function B, you call
the javascript clearTimeout and reset the timer with a call to setTimeout.
When the user is at the computer working the mouse move events will keep
rescheduling the timer. Inside Function A, you call setTimeout with a
suitable time and pass in function A so that function A is called after the
time expires. If the mouse never moves, the timer will run out and the
function A will be called. Function A should ideally pop an alert box and
then redirect the user to a login page. The redirection happens after the
user clicks ok. If the user never comes back the message box remains.
Settimeout etc
http://www.elated.com/articles/javascript-timers-with-settim eout-and-setinterval/
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"WhiskeyRomeo" wrote in message
news:3649679E-7A5F-4DAA-A6F2-ED38F9CAA68F@microsoft.com...
> Yes, thanks for replying -- I know it is a bad approach hence the question
> how can I use JavaScript to control it?
>
> WR
>
> "Alvin Bruney [ASP.NET MVP]" wrote:
>
>> No, that's not a good approach. Think security, I open several hundred
>> connections and now since you allow me to keep those active sessions
>> open,
>> I'll eventually cause your server to run out of memory. If the user walks
>> away, the session should time out otherwise, they need to be at the
>> computer - this long standing design makes sense for a number of
>> different
>> reasons and you should stick to it. Having said that, I've done this as
>> well
>> but set the app pool to recycle at midnight to 'somewhat' mitigate the
>> resource threat. I hope my rambling makes sense to you.
>>
>> --
>>
>> Regards,
>> Alvin Bruney [MVP ASP.NET]
>>
>> [Shameless Author plug]
>> The O.W.C. Black Book, 2nd Edition
>> Exclusively on www.lulu.com/owc $19.99
>> -------------------------------------------------------
>>
>>
>>
>> "WhiskeyRomeo" wrote in message
>> news:6AE33E51-5317-4C0E-BF8D-7D123FEC9749@microsoft.com...
>> > The below appears to be a partial answer to my problem but I don't to
>> > keep
>> > sessions alive simply because a user has wondered off to do something
>> > else.
>> > Session timeout is set to the standard 30 minutes.
>> >
>> > KEEPALIVE.aspx has:
>> > private void Page_Load(object sender, System.EventArgs e)
>> > {
>> > Response.AddHeader("Refresh",8000);
>> > }
>> > MyRegPage.aspx has:
>> >
>> > frameBorder=no width=0 height=0 runat="server">
>> >
>> > I am not a JavaScript programmer but have some very basic skills, how
>> > can
>> > I
>> > use this solution but add an alert button that pops up at the 17 minute
>> > mark
>> > and if they click Ok the KeepAlive.aspx refreshes. If there is no
>> > response
>> > (by the 20 minute mark) the alert box goes away and is replaced by one
>> > that
>> > says "Your Session has timed out. Go to . . ."
>> >
>> > wr
>>
Re: RenewSession State Before Expiration In .Net 1.1
am 18.01.2008 23:07:02 von WhiskeyRomeo
This is all well and good (you are keeping time on the client). But how is
the session state (on the server) kept alive when the use clicks OK on the
alert box button? Once a page loads and there is no post for 20 minutes, his
session should time out. So rather than keeping time via mouse movements, I
just want to keep time between loading of a page and between postbacks. The
alert box should pop up at least 3 minutes before session time expires.
Since I am not going to keep track of session time on the server, I am going
to assume it starts over on page load or on a post back -- like your
suggestion says -- and kept a timer on the client.
If the user clicks OK on the alert box, he should remain on the page he is
on and an invisible post back happens to keep the session alive.
WR
"Alvin Bruney [ASP.NET MVP]" wrote:
> I had code for this but I can't find it. Here's how I remember doing it.
> Create a function that pops a message box. Capture the return value from the
> message box click. Let's call that function A. Map your mouse move events to
> another function, let's call that function B. Inside function B, you call
> the javascript clearTimeout and reset the timer with a call to setTimeout.
> When the user is at the computer working the mouse move events will keep
> rescheduling the timer. Inside Function A, you call setTimeout with a
> suitable time and pass in function A so that function A is called after the
> time expires. If the mouse never moves, the timer will run out and the
> function A will be called. Function A should ideally pop an alert box and
> then redirect the user to a login page. The redirection happens after the
> user clicks ok. If the user never comes back the message box remains.
> Settimeout etc
> http://www.elated.com/articles/javascript-timers-with-settim eout-and-setinterval/
>
> --
>
> Regards,
> Alvin Bruney [MVP ASP.NET]
>
> [Shameless Author plug]
> The O.W.C. Black Book, 2nd Edition
> Exclusively on www.lulu.com/owc $19.99
> -------------------------------------------------------
>
>
>
> "WhiskeyRomeo" wrote in message
> news:3649679E-7A5F-4DAA-A6F2-ED38F9CAA68F@microsoft.com...
> > Yes, thanks for replying -- I know it is a bad approach hence the question
> > how can I use JavaScript to control it?
> >
> > WR
> >
> > "Alvin Bruney [ASP.NET MVP]" wrote:
> >
> >> No, that's not a good approach. Think security, I open several hundred
> >> connections and now since you allow me to keep those active sessions
> >> open,
> >> I'll eventually cause your server to run out of memory. If the user walks
> >> away, the session should time out otherwise, they need to be at the
> >> computer - this long standing design makes sense for a number of
> >> different
> >> reasons and you should stick to it. Having said that, I've done this as
> >> well
> >> but set the app pool to recycle at midnight to 'somewhat' mitigate the
> >> resource threat. I hope my rambling makes sense to you.
> >>
> >> --
> >>
> >> Regards,
> >> Alvin Bruney [MVP ASP.NET]
> >>
> >> [Shameless Author plug]
> >> The O.W.C. Black Book, 2nd Edition
> >> Exclusively on www.lulu.com/owc $19.99
> >> -------------------------------------------------------
> >>
> >>
> >>
> >> "WhiskeyRomeo" wrote in message
> >> news:6AE33E51-5317-4C0E-BF8D-7D123FEC9749@microsoft.com...
> >> > The below appears to be a partial answer to my problem but I don't to
> >> > keep
> >> > sessions alive simply because a user has wondered off to do something
> >> > else.
> >> > Session timeout is set to the standard 30 minutes.
> >> >
> >> > KEEPALIVE.aspx has:
> >> > private void Page_Load(object sender, System.EventArgs e)
> >> > {
> >> > Response.AddHeader("Refresh",8000);
> >> > }
> >> > MyRegPage.aspx has:
> >> >
> >> > frameBorder=no width=0 height=0 runat="server">
> >> >
> >> > I am not a JavaScript programmer but have some very basic skills, how
> >> > can
> >> > I
> >> > use this solution but add an alert button that pops up at the 17 minute
> >> > mark
> >> > and if they click Ok the KeepAlive.aspx refreshes. If there is no
> >> > response
> >> > (by the 20 minute mark) the alert box goes away and is replaced by one
> >> > that
> >> > says "Your Session has timed out. Go to . . ."
> >> >
> >> > wr
> >>
>
Re: RenewSession State Before Expiration In .Net 1.1
am 19.01.2008 19:51:08 von Alvin Bruney
These are two different clocks unrelated to each other where client clock is
(server clock - 3min) so that client always times out before server. In your
case you can, on server click ok, fire an AJAX dummy call.
> to assume it starts over on page load or on a post back -- like your
> suggestion says -- and kept a timer on the client.
Right.
> the session state (on the server) kept alive when the use clicks OK on the
> alert box button? Once a page loads and there is no post for 20 minutes,
> his
> session should time out. So rather than keeping time via mouse movements,
> I
> just want to keep time between loading of a page and between postbacks.
> The
Right, but there is no event that fires on the server that allows you to do
that. If you handle session end, it's too late. There's no
Session_AbouttoEnd event that is available, although that may be a good
feature improvement. The only thing that comes to mind is client clock set
to some value less than the server timeout clock and these two are reset
with each mouse movement.
--
Regards,
Alvin Bruney [MVP ASP.NET]
[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------
"WhiskeyRomeo" wrote in message
news:911D7614-DC78-4214-84A6-DA1FE0B8E96B@microsoft.com...
> This is all well and good (you are keeping time on the client). But how
> is
> the session state (on the server) kept alive when the use clicks OK on the
> alert box button? Once a page loads and there is no post for 20 minutes,
> his
> session should time out. So rather than keeping time via mouse movements,
> I
> just want to keep time between loading of a page and between postbacks.
> The
> alert box should pop up at least 3 minutes before session time expires.
> Since I am not going to keep track of session time on the server, I am
> going
> to assume it starts over on page load or on a post back -- like your
> suggestion says -- and kept a timer on the client.
>
> If the user clicks OK on the alert box, he should remain on the page he is
> on and an invisible post back happens to keep the session alive.
>
> WR
>
> "Alvin Bruney [ASP.NET MVP]" wrote:
>
>> I had code for this but I can't find it. Here's how I remember doing it.
>> Create a function that pops a message box. Capture the return value from
>> the
>> message box click. Let's call that function A. Map your mouse move events
>> to
>> another function, let's call that function B. Inside function B, you call
>> the javascript clearTimeout and reset the timer with a call to
>> setTimeout.
>> When the user is at the computer working the mouse move events will keep
>> rescheduling the timer. Inside Function A, you call setTimeout with a
>> suitable time and pass in function A so that function A is called after
>> the
>> time expires. If the mouse never moves, the timer will run out and the
>> function A will be called. Function A should ideally pop an alert box and
>> then redirect the user to a login page. The redirection happens after the
>> user clicks ok. If the user never comes back the message box remains.
>> Settimeout etc
>> http://www.elated.com/articles/javascript-timers-with-settim eout-and-setinterval/
>>
>> --
>>
>> Regards,
>> Alvin Bruney [MVP ASP.NET]
>>
>> [Shameless Author plug]
>> The O.W.C. Black Book, 2nd Edition
>> Exclusively on www.lulu.com/owc $19.99
>> -------------------------------------------------------
>>
>>
>>
>> "WhiskeyRomeo" wrote in message
>> news:3649679E-7A5F-4DAA-A6F2-ED38F9CAA68F@microsoft.com...
>> > Yes, thanks for replying -- I know it is a bad approach hence the
>> > question
>> > how can I use JavaScript to control it?
>> >
>> > WR
>> >
>> > "Alvin Bruney [ASP.NET MVP]" wrote:
>> >
>> >> No, that's not a good approach. Think security, I open several hundred
>> >> connections and now since you allow me to keep those active sessions
>> >> open,
>> >> I'll eventually cause your server to run out of memory. If the user
>> >> walks
>> >> away, the session should time out otherwise, they need to be at the
>> >> computer - this long standing design makes sense for a number of
>> >> different
>> >> reasons and you should stick to it. Having said that, I've done this
>> >> as
>> >> well
>> >> but set the app pool to recycle at midnight to 'somewhat' mitigate the
>> >> resource threat. I hope my rambling makes sense to you.
>> >>
>> >> --
>> >>
>> >> Regards,
>> >> Alvin Bruney [MVP ASP.NET]
>> >>
>> >> [Shameless Author plug]
>> >> The O.W.C. Black Book, 2nd Edition
>> >> Exclusively on www.lulu.com/owc $19.99
>> >> -------------------------------------------------------
>> >>
>> >>
>> >>
>> >> "WhiskeyRomeo" wrote in
>> >> message
>> >> news:6AE33E51-5317-4C0E-BF8D-7D123FEC9749@microsoft.com...
>> >> > The below appears to be a partial answer to my problem but I don't
>> >> > to
>> >> > keep
>> >> > sessions alive simply because a user has wondered off to do
>> >> > something
>> >> > else.
>> >> > Session timeout is set to the standard 30 minutes.
>> >> >
>> >> > KEEPALIVE.aspx has:
>> >> > private void Page_Load(object sender, System.EventArgs e)
>> >> > {
>> >> > Response.AddHeader("Refresh",8000);
>> >> > }
>> >> > MyRegPage.aspx has:
>> >> >
>> >> > frameBorder=no width=0 height=0 runat="server">
>> >> >
>> >> > I am not a JavaScript programmer but have some very basic skills,
>> >> > how
>> >> > can
>> >> > I
>> >> > use this solution but add an alert button that pops up at the 17
>> >> > minute
>> >> > mark
>> >> > and if they click Ok the KeepAlive.aspx refreshes. If there is no
>> >> > response
>> >> > (by the 20 minute mark) the alert box goes away and is replaced by
>> >> > one
>> >> > that
>> >> > says "Your Session has timed out. Go to . . ."
>> >> >
>> >> > wr
>> >>
>>