Session Timeout

G

Guest

I am having problems with my sessions timing out on a windows 2003 server. I
have set the timeout in the web.config as well as in the application
properties. It works fine on a windows 2000 server. Any ideas?
 
L

Lucas Tam

I am having problems with my sessions timing out on a windows 2003
server. I have set the timeout in the web.config as well as in the
application properties. It works fine on a windows 2000 server. Any
ideas?

What is the timeout set to?
 
B

Bruce Barker

if you are using inproc sessions, you also need to turn off auto appdomain
recycles.

-- bruce (sqlwork.com)
 
G

Guest

How would I do that Bruce?
--
Mike Hollibaugh


Bruce Barker said:
if you are using inproc sessions, you also need to turn off auto appdomain
recycles.

-- bruce (sqlwork.com)
 
D

Darren Kopp

run inetmgr from the run command

-locate the application pool that your app is running in
-change the worker process recycling time
-also I would recommend under the performance tab unchecking the
shutdown after idle time check box.

-Darren Kopp
http://blog.secudocs.com/
 
G

George

600 Minutes session timeout is a bad thing to have.

Do not touch 20 minutes value, instead you can implement following code to preserve session if browser is open

The idea is to have a Browser request an aspx page every 10 minutes. So it will refresh the session. If browser is closed then session will expire in 20 minutes.



Add this script to each page.

<script language="Javascript">
window.setInterval("renewSession()", 100000);

function renewSession()
{
document.images("renewSession").src = "/renewSession.aspx?par=" + Math.random();
}
</script>

Add somewere on a page transparent gif.
<IMG name="renewSession" height=6 src="/English/Club/images/transparentpixal.gif" width=1 border=0>


Then you need to have renewSession.aspx which will return 1x1 transparent pixel GIF.


This is a code for that page
public class renewSession : System.Web.UI.Page

{

static byte [] gif = {0x47,0x49,0x46,0x38,0x39,0x61,0x01,0x00,0x01,0x00,0x91,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0xf9,0x04,0x09,0x00,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x08,0x04,0x00,0x01,0x04,0x04,0x00,0x3b,0x00};

override protected void OnInit(EventArgs e)

{



InitializeComponent();

base.OnInit(e);

}


private void InitializeComponent()

{

Response.AddHeader("ContentType", "image/gif");

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Response.BinaryWrite(gif);

Response.End();

}

}


George.

600 minutes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,079
Messages
2,570,574
Members
47,207
Latest member
HelenaCani

Latest Threads

Top