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