Important alert: (current site time 7/15/2013 11:17:17 PM EDT)
 

VB icon

_-~Who is looking at your site? v1.3~-_

Email
Submitted on: 6/24/2002 3:28:11 PM
By: JSBeckerist  
Level: Intermediate
User Rating: By 12 Users
Compatibility: ASP (Active Server Pages), HTML
Views: 23517
(About the author)
 
     Allows you to see the user sessions and pages that each user is viewing on your website currently. Updated so now it works, but just hides the application variables. PLEASE VOTE FOR THIS SCRIPT! Kudos to Brian Battles, check out his scripts. Plus, you have to love statistics... Otherwise don't bother :) Its a pain but if you need to know stats (like me) its worth it.

 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
' for :_-~Who is looking at your site? v1.3~-_
'**************************************
Go to Beckerist.com for a working model. Use this code freely... PLEASE VOTE FOR THIS CODE!
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: _-~Who is looking at your site? v1.3~-_
' Description:Allows you to see the user sessions and pages that each user is viewing on your website currently. Updated so now it works, but just hides the application variables. PLEASE VOTE FOR THIS SCRIPT! Kudos to Brian Battles, check out his scripts. Plus, you have to love statistics... Otherwise don't bother :) Its a pain but if you need to know stats (like me) its worth it.
' By: JSBeckerist
'
' Assumes:Must be able to use a global.asa. Almost impossible to use without. Be sure to set your session timeout to 10 minutes or so if at all possible. You will see a bunch of people that aren't there if you don't.
'
' Side Effects:Good idea to restart your global.asa file as often as possible.
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=7634&lngWId=4'for details.'**************************************

<!--This goes into a page which you include on ALL PAGES IN YOUR SITE... This is how you post things so that you can list them-->
<%APPLICATION.LOCK
sSessURL= Request.ServerVariables ("URL")
sQString= Request.ServerVariables ("QUERY_STRING")
if sQString <>"" then
sSessURL=sSessURL&"?"&sQString
end if
if session("name1")<>"" then
	Application("yoyo"&Session.SessionID) = Null
	sSessID=session("name1")
else 
	sSessID = Session.SessionID
end if
Application("yoyo"&sSessID) = sSessURL
APPLICATION.UNLOCK
%>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~New Page~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--This is the page that you want to output the users on, you can add more variables as it goes on-->
<h2 align="center">Yourdomain.com Stats - Who Is Online?</h2>
<BR>
<!--#include virtual="include_top_page.asp"--><center>
<%if request.form("name1")<>"" then
session("name1")=request.form("name1")
elseif session("name1")<>"" then%>
Hello <%=session("name1")%>!
<%else%>
<form method="Post" action="">
Give yourself a name: 
<input type="text" name="name1"><input type="submit" value="Give me the name!"></form>
<%end if%>
<table>
<tr><td width="50%">Session ID</td><td>Looking where?</td></tr>
<%
 For Each strSV in Application.Contents
 		if left(strSV,4)="yoyo" then
if Application.Contents(strSV)<>"" then%> 		
 <tr><td><%=mid(strSV,5,999)%></td><td><%=Application.Contents(strSV)%></td></tr>
<%end if%><% end if
 Next%></table>New Page~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!-- This next part goes in the session_onend sub in your global.asa file-->
Sub Session_OnEnd			
	Application.Lock
		sSessID = Session.SessionID
		Application("yoyo"&sSessID) = ""
	Application.Remove "yoyo"&sSessID
	Application.Unlock
End Sub


Other 7 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

6/25/2002 8:37:12 AMJohn

If anyone knows how to delete Application variables... :-P Slight oversight on my part :-D. I am putting a new version up this afternoon (if I haven't already by the time you read this) that at least attempts to get rid of the variable... Also allows you to choose your own name...
(If this comment was disrespectful, please report it.)

 
6/25/2002 3:09:37 PMwebmaster@adefwebserver.com

hey
(If this comment was disrespectful, please report it.)

 
7/4/2002 5:37:16 PMTuomas

How to delete application variables:

Application.Contents.Remove("something")

I have found no documentation for it, but it works.
(If this comment was disrespectful, please report it.)

 
8/2/2002 1:26:55 PMLewis Moten

Looks like a performance killer in the application. Why not store this information in a disconnected recordset, and remove the entry when the session expires?
(If this comment was disrespectful, please report it.)

 
9/22/2002 11:26:44 PMDheeraj Mahajan

hi,
can anyone tell me how can i kill a particular session remotely as an Administrator.

Regards
Dheeraj
(If this comment was disrespectful, please report it.)

 
3/16/2007 7:41:59 AMvipin kumar


good
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.