Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Session.Timeout after 20 seconds not working

Reply
Thread Tools

Session.Timeout after 20 seconds not working

 
 
Astrix
Guest
Posts: n/a
 
      07-16-2007
Hi,

I have been working with Sessions for some weeks now, but i can't seem
to solve this issue. Please have a look ..

void Page_Load(Object sender, EventArgs e)
{
//BLAH BLAH
Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout *
60) - 1180) +"; URL=index.aspx");
//BLAH BLAH

}

I have set the Refresh to 20 seconds.. Although I refreshed this page
a number of times, the page gets automatically redirected after 20
seconds no matter how many times i refreshed the page in between ?

Any help will be appriciated..

Thankyou,
Astrix

 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      07-16-2007
Hmm. I don't have this issue at all. If I repeatedly refresh the page (before
the expiry time) it never redirects to the other page.
1) Your browser may be caching this, so you can try some no-cache code.
2) You can also try script - using window.setTimeout or setInterval and then
location.href =newpage.aspx
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com



"Astrix" wrote:

> Hi,
>
> I have been working with Sessions for some weeks now, but i can't seem
> to solve this issue. Please have a look ..
>
> void Page_Load(Object sender, EventArgs e)
> {
> //BLAH BLAH
> Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout *
> 60) - 1180) +"; URL=index.aspx");
> //BLAH BLAH
>
> }
>
> I have set the Refresh to 20 seconds.. Although I refreshed this page
> a number of times, the page gets automatically redirected after 20
> seconds no matter how many times i refreshed the page in between ?
>
> Any help will be appriciated..
>
> Thankyou,
> Astrix
>
>

 
Reply With Quote
 
 
 
 
Astrix
Guest
Posts: n/a
 
      07-16-2007
Thank you for the feedback Peter. You are right Thanks..

But i have another doubt,

The client will redirect with the above code, how will the server know
that the client has redirected to another page thou ?


 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      07-16-2007
Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout *
60) - 1180) +"; URL=index.aspx?id=" + youruserId.ToString() );

Pick up the Request.QueryString["id"] in the target page.
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com



"Astrix" wrote:

> Thank you for the feedback Peter. You are right Thanks..
>
> But i have another doubt,
>
> The client will redirect with the above code, how will the server know
> that the client has redirected to another page thou ?
>
>
>

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      07-16-2007
re:
!> how will the server know that the client has redirected to another page though ?

It won't...unless you include the user's info in the querystring or in a hidden field.





Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espańol : http://asp.net.do/foros/
======================================
"Astrix" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) ups.com...
> Thank you for the feedback Peter. You are right Thanks..
>
> But i have another doubt,
>
> The client will redirect with the above code, how will the server know
> that the client has redirected to another page thou ?
>
>



 
Reply With Quote
 
=?ISO-8859-1?Q?G=F6ran_Andersson?=
Guest
Posts: n/a
 
      07-17-2007
Astrix wrote:
> Thank you for the feedback Peter. You are right Thanks..
>
> But i have another doubt,
>
> The client will redirect with the above code, how will the server know
> that the client has redirected to another page thou ?
>


The only way the server can know that is that the browser is requesting
the "another page".

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
Astrix
Guest
Posts: n/a
 
      07-17-2007
Thankyou all for the comments, I now understand the concept.

Thankyou,
Astrix

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert Seconds to X Hours Y Minutes Z Seconds? 00_CP_D12 ASP .Net 3 02-22-2008 10:37 AM
convert seconds to hours:minutes:seconds `p Ruby 7 12-14-2005 03:32 PM
1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds Michael Tan Ruby 32 07-21-2005 03:23 PM
Convert seconds to minutes and seconds tshad ASP .Net 7 03-11-2005 11:27 PM
Converting seconds to (Days, Hours, Minutes, seconds) Stu C Programming 7 03-07-2005 08:44 AM



Advertisments