Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Session.Timeout after 20 seconds not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Astrix - 16 Jul 2007 18:20 GMT
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
Peter Bromberg [C# MVP] - 16 Jul 2007 18:56 GMT
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
Signature

Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
bogMetaFinder:    http://www.blogmetafinder.com

> Hi,
>
[quoted text clipped - 18 lines]
> Thankyou,
> Astrix
Astrix - 16 Jul 2007 20:35 GMT
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 ?
Peter Bromberg [C# MVP] - 16 Jul 2007 20:42 GMT
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.
Signature

Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
bogMetaFinder:    http://www.blogmetafinder.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 ?
Juan T. Llibre - 16 Jul 2007 20:52 GMT
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/
======================================
> 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 ?
Göran Andersson - 17 Jul 2007 12:26 GMT
> 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".

Signature

Göran Andersson
_____
http://www.guffa.com

Astrix - 17 Jul 2007 16:18 GMT
Thankyou all for the comments, I now understand the concept.

Thankyou,
Astrix

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.