same user multiple logins(solved)
hi all,
i am new subscriber to this site.this is my first letter to this group.
my problem is how to restrict the user from login more than one machine at the same time.
for this i have written some code in session_OnEnd which is in global.asa file.it shoulb fire when the session is expired.but it is not working.here i am giving my code which is in global.asa file
<script language="vbscript" runat="server">
sub Application_OnStart
end sub
sub Application_OnEnd
''code to remove all user names
for each x in Application.Contents
Application.Contents.Remove(x)
next
end sub
sub Session_OnEnd
''code to remove the user,whose session is expired
for each x in Application.Contents
if Application.Contents(x)= session("user_id")
Application.Contents.Remove(x)
end if
next
end sub
</script>
first, i tell what i am doing in login page.
when user logged in to my application i am storing userid in application.contents object after checking whether userid is already exist or not.if not ia m storing user id in application contents.till here this is fine and its working properly.
but the thing is in the above code i am trying to remove the userid
(whose session is expired) from the application.contents list
it is not working, can you help me.
|