473,382 Members | 1,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Session.Timeout after 20 seconds not working

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

Jul 16 '07 #1
6 2215
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

Jul 16 '07 #2
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 ?
Jul 16 '07 #3
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 ?
Jul 16 '07 #4
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" <ag*****@gmail.comwrote in message news:11*********************@q75g2000hsh.googlegro 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 ?


Jul 16 '07 #5
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
Jul 17 '07 #6
Thankyou all for the comments, I now understand the concept.

Thankyou,
Astrix

Jul 17 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sameer | last post by:
Hello All, I have a simple JSP which looks like this <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <%@ page session="true"%> <HTML> <HEAD> <meta HTTP-EQUIV="refresh"...
11
by: Colin Steadman | last post by:
I'm using the following code in my global.asa file to set the session.timeout value amongst other things - Sub Session_OnStart Session.Timeout = 40 Session("Authenticated") ...
12
by: Geigho | last post by:
Setting session timeout in web.config file does not seem to have any effect. Any explanation or suggestion will be appreciated.
1
by: Scott Walters | last post by:
Hi, I have an asp.net webapp that uses some javascript in a hidden frame on the browser to poll the server every 30 seconds, using an http post. I also want my sessions to timeout in the...
6
by: Nedu N | last post by:
Hi, I am trying to design a Home page for my applicatiion in which i want show the links for for some itms... I tried to put the following <td> <font face="Arial, Helvetica, sans-serif" ...
2
by: Lars Netzel | last post by:
There's a setting in the IIS where I have set Enabled Session Timeout to 20 minutes Then there's a setting in the WebConfig file.. <sessionState mode="InProc"...
17
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be...
2
by: Astrix | last post by:
Hi, I am working on a problem w.r.t session.timeout I have a code to redirect to this new page after 20 seconds. Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60) -...
2
by: Astrix | last post by:
I have been working on session timeout for an application and I got a lot of help from this discussion Board. My Thanks to all of you. For e.g If i have a website which has multiple pages, I...
6
by: ChrisAtWokingham | last post by:
I have been struggling with unexpected error messages on an ASP.NET system, using SQL and C#. The application draws organisation charts, based on data stored in the SQL database. Some of the chart...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.