PDA

View Full Version : How to kill a session when window is closed



joecool2005
01-17-2007, 05:21 PM
Hi,

On my website I have a section that can open a new window when the users click on it. When the users close the new window, my session variable are still alive. I don't know how to kill it.

I added these lines on my global.asa and the session is still alive.
function Session_OnEnd() {
Session.Contents.RemoveAll();
Session.Abandon();
}

The global.asa execute when a new window is open.

Example:

<a href="java script:void(0)" onclick="window.open('https://secure.drtax.ca/ufileshop/2006/storespec.asp')">2006</a>
<a href="java script:void(0)" onclick="window.open('https://secure.drtax.ca/ufileshop/2005/storespec.asp?taxyear=2005')">2005</a>

By clicking on both links, you will see the same year because the year is a session variable. It's supposed to show 2006 on one page and the other 2005.

How can I fix it?
Thx
Joe