469,327 Members | 1,277 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

List of users ins ASP-Site

Before users can use my asp-site, they have to login.
The username is stored in a session variable "USR".
I need a list of all users that are active in my site.
I tried to store the logged usernames in an application
variable when they login in the default.asp site:
Application("AktiveUser") = Application("AktiveUser")
& "<BR>" & Session(USR")
When the Session ends, the username is deleted from the
application variable like this :
Function session_OnEnd in Global.asa
Application("AktiveUser") = ReplaceString(Application
("AktiveUser"), "<BR>" & Session("usr"), "")
Problem : In this function the session variable "USR" is
empty, so the name can not be deleted.
Has anyone a better idea to get a list of active users ?
Thank you all.
Jul 19 '05 #1
1 1604
"Hollek" wrote ...
Has anyone a better idea to get a list of active users ?
Thank you all.

I wouldnt call this a 'better' idea, as I expect that the application
variables are typically people use for this however...

You could, upon login set a flag against the users details in the database
(I'm assuming you're using one here)..

You would also need to store the date/time in the database which the user
last did something - and include this update routine on each page, ie, each
time that user arrives at a page it updates the value in the database to
equal the date/time now.

Not sure what your 'inactive' time is - but I'll assume its 20 minutes - so
you'd also want to create a job that runs on the database (assuming more sql
server in my thoughts at the moment) - every 20 mins or so to check for
expired logins, this would use the above date/time field for its values -
finding any it would set the 'logged in' flag back to 'not logged in' etc..

Once this is running nicely, all you'd need to do is create perhaps a view
of the users where the logged in flag was set to true and then pull their
names out and list them on the page or whatever you want to do with them....

As I said initially I expect most people just use application variables -
but this would be an alternative..



Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by J P Singh | last post: by
8 posts views Thread by Guy Hocking | last post: by
15 posts views Thread by C White | last post: by
5 posts views Thread by Kay | last post: by
reply views Thread by johnnyG | last post: by
2 posts views Thread by rn5a | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.