Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do I window.close after session.timeout

Status
Not open for further replies.

yongbum

Programmer
Dec 15, 2005
48
IL
Hi,
I have the following in code-behind Page_Load

Response.appendheader("refresh", convert.tostring(session.timeout * 60) & "; URL=Login.aspx")

instead of redirecting on timeout I'd like to do window.close. How do I do this ?
 
You need javascript for that. But i am not sure if when the line "window.close();" executes, that the window will be closed; A messagebox may popup to the user to confirm whether or not to close.
Also i do not know what happens if the user has not javascripting enabled.

It is better than closing the window, to redirect the user to the login page (the auth cookie will have expired when session ends).
 
Thanks TipGiver

What I did (and it works) is to redirect to a page which has <body onload="setTimeout('window.close()', 10);">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top