re:
This javascript code, would I put this
on each of my pages for my site???
If all you want to do is insure that your users will always
have Session contents available, i.e., insure that their
sessions don't timeout when they leave their browsers
open on the same page, without doing anything alse for
a period of time which is larger that your Session Timeout
setting, all you'd need to do is use a Meta Refresh tag :
<meta http-equiv="refresh" content="600">
That would refresh the page every 10 minutes (600 seconds).
If you need a higher value, set the number to a larger value.
That is much simpler than the JavaScript solution,
which doesn't synchronize with Session timeout, anyway.
Be forewarned : users don't like applications/servers
messing with how they view the site, and this strategy
may well backfire on you, as would any other method
you use to insure that a page will refresh, or that a user
will be redirected against his will to other pages.
re:
and whatabout this code,
do i need to put it in my global page too??
As previously said, setting
protected void Session_End(Object sender, EventArgs e)
Response.Redirect( "login.aspx" );
will *not* work because when the session ends
the server has no way of sending a response to
the client, who might be long gone, anyway.
Juan T. Llibre
ASP.NET MVP
===========