How can I know how many sessions has opened in IIS now.

Results 1 to 3 of 3

Thread: How can I know how many sessions has opened in IIS now.

  1. #1
    Mamata Tripathy Guest

    Default How can I know how many sessions has opened in IIS now.

    Is there any method or property to know how many <BR><BR>sessions has opened in IIS now. <BR><BR>Please help.<BR><BR><BR>Mamata Tripathy<BR>EMail : mamatatripathy@hotmail.com<BR>Infozech Software Pvt Ltd.<BR>New Delhi<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: How can I know how many sessions has opened in IIS now.

    There is a great article at 4Guys explaining how to use a simple hit counter which keeps track of the number of total sessions that have been used. To keep track of the number of current sessions, just use the code available at the article via the URL below:<BR><BR>http://www.4guysfromrolla.com/webtech/120398-1.shtml<BR><BR>But you will need to add one thing: you will need to add in Session_OnEnd a line of code to decrement your Application("Hits") variable. Do this like so;<BR><BR>Application.Lock<BR>Application("Hits") = Application("Hits") - 1<BR>Application.UnLock<BR><BR>That&#039s all there is to it! Then, any time you want to see the current number of sessions from an ASP page, just put:<BR><BR>Response.Write("There are " & Application("Hits") & " current sessions!")<BR><BR>NOTE: You may want to change the variable name from Application("Hits") to something more appropriate, like Application("CurrentUsers")... Just an idea!<BR><BR>Happy Programming!

  3. #3
    Mamata Tripathy Guest

    Default RE: How can I know how many sessions has opened in IIS now.

    Thanks for your information. I have seen this article after posting this message. I think you have not seen another message posted by me. <BR><BR>The main problem I am facing is : the "Session_onEnd" event does not fire when session ends. I want to delete some information from the SQL table when session ends.<BR>Right now in my application multiple users can enter in it using a single user id and password. But I do not want this. I want to restrict the user. If one user enters into the application with a user id and password, no more users can enter in to it with the same user id and password.<BR><BR>What I tried is :<BR><BR>When one user enters in to my application, I am inserting the userid and sessionid to track the user. When another user tries to enter I just checks the user already entered or not. If there is a record, then I don&#039t allow him to enter in to the application. But when session ends, I want to delete the user information, so that the same user can enter from differnet location or machine. I tried this by writing all this in the Session_onend event but it does not work.<BR><BR>Could you please tell me any alternatives or any problem in settings or anythingelse. I am unable to understand why this event does not fire.<BR><BR>Thanks a lot.<BR><BR>Mamata Tripathy<BR>Email : mamatatripathy@hotmail.com<BR>Infozech Software Pvt Ltd<BR>New Delhi - 17<BR>India<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •