If you run session_OnEnd you cant store a session variable afterwards. If you want to destroy an application variable that is held in session state
then create the destroy script under Sub Session_OnEnd in the asa. And this does not always work if the browser is just shut down. The session state gets destroyed but sometimes the application variable does not.