Viktor Popov wrote:
Hi, Thanks for the reply!
I would like to run this code on the client side:
void private signout()
{
HttpContext.Current.Cache.Remove(Session["usrName"].ToString());
Session["user"]=null;
Session["usrName"]=null;
FormsAuthentication.SignOut();
}
How could be accomplished that?
I don't know exactly where should be written this function.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.760 / Virus Database: 509 - Release Date: 10.9.2004 ã.
Viktor,
You can't do that.
1. You need to use JavaScript or VBScript on client site
2. Codebehind namespaces, sessions etc. are server objects not client.
Basically what you can do is in onunload event, call a client side
function signout, that will pop-up a window and in this window you will
just run the server side (codebehind) logic (the one you defined) and in
this pop-up windows onload event close that window with window.close().
However, as you see, this will not work all the time.
On the other hand,
1. I don't think you should keep user name in Cache object (Cache is
like Application variable, shared by everything on that application)
2. When the user closes window, his/her session will be killed anyway
and they cannot reached this session again, unless they didn't close all
related pages.
I hope this helps/
--
SevDer
http://www.sevder.com