Global.asa & session & load balancing
Hi everybody
well the problem i have is about global.asa file.
In the company i work there is a web site in a farm, i.e., 2 or 3 servers response the requests, so how we need to have a login in the web site, we used it session variables, but there were a problem when we used load balancing with W2K AS in the farm: if a different web server responses the request the session variables were lost, so i try to investigate several solutions and i found things like instead of session objects utilize cookies but it is not so secure, or with hardware instead of software: it is a load balancer device, or buy software which solve this problem, but here in the enterprise they take care their money, another one is the client affinity but is not so efficient or LDAO with site server but it requires certain quantity of time that in the enterprise dont wanna take, so the most adequate solutions it was create a database application for maintain state user information in the web site, So i make a component with a little table with 4 fields to mantain the session active an inactive depend on the case, but i found a problem, when the user doesn´t logout and instead of this he/she close the explorer the session (it is the register in the table) is actived, so i decided use the global.asa to call a subroutine in the session_onend, this routine must create an object of the component i create and delete the register of the session, each time the user refresh a page or he/she go to another the session updates, and a session variable also, this session variable i use it like parameter to delete the register, here i put the code
sub Session_OnEnd
dim varUserName
varUserName = Session("username")
dim objDestroy
set objDestroy = Server.CreateObject("Usuario.Sesion")
objDestroy.destroySession(varUserName)
set objDestroy = nothing
end sub
its clear that if the session variable username is timeout the function destroySession is not gonna work, but it is the unique slution i have found, so please experts help me, i gonna be investigating what else i can do, so give me tips, code, a link to download a free component o software i dont know, well i ope u can help me.
Bye
PD I hope my english be clear.
|