p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_forms thread: Multiple Logins Problem


Message #1 by akifnoor@y... on Wed, 27 Feb 2002 10:48:55
I have developed a site and from our client we have a requirement that

at any time only one user can be log in to the server with the same

user name.



it means 



same user can't log in from different machines.



if one user is log in from one machine it can't be 

log in from any other machine till first user is logged off.



if any body have some idea plz share with me .

thanks

akif noor
Message #2 by "Bharat Saboo" <bharatsaboo@h...> on Wed, 27 Feb 2002 16:23:27 +0530
try using session variables



bharat





>From: akifnoor@y...

>Reply-To: "ASP Forms" <asp_forms@p...>

>To: "ASP Forms" <asp_forms@p...>

>Subject: [asp_forms] Multiple Logins Problem

>Date: Wed, 27 Feb 2002 10:48:55

>

>I have developed a site and from our client we have a requirement that

>at any time only one user can be log in to the server with the same

>user name.

>

>it means

>

>same user can't log in from different machines.

>

>if one user is log in from one machine it can't be

>log in from any other machine till first user is logged off.

>

>if any body have some idea plz share with me .

>thanks

>akif noor








_________________________________________________________________

Send and receive Hotmail on your mobile device: http://mobile.msn.com



Message #3 by Brent Latham <Brent2@w...> on Wed, 27 Feb 2002 11:19:06 -0000
Session variables wouldn't help as a Session is only good for the Logged on

User!



That means on any application you have designed you can have multiple

windows open and each window you can be logged on to your system!



Try it :)



cheers

Brent



-----Original Message-----

From: Bharat Saboo [mailto:bharatsaboo@h...]

Sent: 27 February 2002 10:53

To: ASP Forms

Subject: [asp_forms] Re: Multiple Logins Problem





try using session variables



bharat





>From: akifnoor@y...

>Reply-To: "ASP Forms" <asp_forms@p...>

>To: "ASP Forms" <asp_forms@p...>

>Subject: [asp_forms] Multiple Logins Problem

>Date: Wed, 27 Feb 2002 10:48:55

>

>I have developed a site and from our client we have a requirement that

>at any time only one user can be log in to the server with the same

>user name.

>

>it means

>

>same user can't log in from different machines.

>

>if one user is log in from one machine it can't be

>log in from any other machine till first user is logged off.

>

>if any body have some idea plz share with me .

>thanks

>akif noor








_________________________________________________________________

Send and receive Hotmail on your mobile device: http://mobile.msn.com








Message #4 by akif noor <akifnoor@y...> on Wed, 27 Feb 2002 03:18:47 -0800 (PST)
I have tried the solution of session variables.

but if u can explain in detail it will be easy for me



Bye

akif noor



--- Bharat Saboo <bharatsaboo@h...> wrote:

> try using session variables

> 

> bharat

> 

> 

> >From: akifnoor@y...

> >Reply-To: "ASP Forms" <asp_forms@p...>

> >To: "ASP Forms" <asp_forms@p...>

> >Subject: [asp_forms] Multiple Logins Problem

> >Date: Wed, 27 Feb 2002 10:48:55

> >

> >I have developed a site and from our client we have

> a requirement that

> >at any time only one user can be log in to the

> server with the same

> >user name.

> >

> >it means

> >

> >same user can't log in from different machines.

> >

> >if one user is log in from one machine it can't be

> >log in from any other machine till first user is

> logged off.

> >

> >if any body have some idea plz share with me .

> >thanks

> >akif noor





> $subst('Email.Unsub').

> 

> 

>

_________________________________________________________________

> Send and receive Hotmail on your mobile device:

> http://mobile.msn.com

> 

> 





$subst('Email.Unsub').





=====





__________________________________________________

Do You Yahoo!?

Yahoo! Greetings - Send FREE e-cards for every occasion!

http://greetings.yahoo.com

Message #5 by "David Slater" <proc_dev@h...> on Wed, 27 Feb 2002 12:00:33 +0000
You need a database authentication system.

You need to store the user name in a db with a column that gets set to 1 say 

when they are logged in.

When a user tries to login you look for this column to see if it set to 1 or 

not.

The problem comes when they don't log out properly. So I guess its some 

combination of session variables and a db to store the details.





>From: akif noor <akifnoor@y...>

>Reply-To: "ASP Forms" <asp_forms@p...>

>To: "ASP Forms" <asp_forms@p...>

>Subject: [asp_forms] Re: Multiple Logins Problem

>Date: Wed, 27 Feb 2002 03:18:47 -0800 (PST)

>

>I have tried the solution of session variables.

>but if u can explain in detail it will be easy for me

>

>Bye

>akif noor

>

>--- Bharat Saboo <bharatsaboo@h...> wrote:

> > try using session variables

> >

> > bharat

> >

> >

> > >From: akifnoor@y...

> > >Reply-To: "ASP Forms" <asp_forms@p...>

> > >To: "ASP Forms" <asp_forms@p...>

> > >Subject: [asp_forms] Multiple Logins Problem

> > >Date: Wed, 27 Feb 2002 10:48:55

> > >

> > >I have developed a site and from our client we have

> > a requirement that

> > >at any time only one user can be log in to the

> > server with the same

> > >user name.

> > >

> > >it means

> > >

> > >same user can't log in from different machines.

> > >

> > >if one user is log in from one machine it can't be

> > >log in from any other machine till first user is

> > logged off.

> > >

> > >if any body have some idea plz share with me .

> > >thanks

> > >akif noor





> > $subst('Email.Unsub').

> >

> >

> >

>_________________________________________________________________

> > Send and receive Hotmail on your mobile device:

> > http://mobile.msn.com

> >

> >





>$subst('Email.Unsub').

>

>

>=====

>

>

>__________________________________________________

>Do You Yahoo!?

>Yahoo! Greetings - Send FREE e-cards for every occasion!

>http://greetings.yahoo.com

>








_________________________________________________________________

Chat with friends online, try MSN Messenger: http://messenger.msn.com



Message #6 by "Daniel" <daniel@o...> on Wed, 27 Feb 2002 07:26:26 -0500
building on this...

if you use te database like david has mentioned (which i think is the most

scaleable method) you will have a legitmante problem with users not logging

out and cleaning up. so to fix this problem, or somewhat fix it, when you

havigate to the login page, after login is succeeded, popup a new window.

now you have control of that window. then in that new window that you

opened, have a frameset, with only 2 frames, the top one will contain your

pages, and the bottom one will only be 1px tall, then in the frameset page

set the onunload event to call a function from the parent window

(window.opener.functionname) the function in the parent window will clean up

the user info, now you also should have a button that will call this same

function. but this will cause problems if they log out and then it will try

to log out automatically. so then set a variable on the parent window page

to = 1 if they logged out, or leave it to 0 if not, then in the function you

can test and only have the onunload event call the function if the value is

= 0.



this is all just coming from my brain.. and i havnt tested.. but try it out.

the onunload event may or may not work.. but let us know!



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"David Slater" <proc_dev@h...> wrote in message

news:151043@a..._forms...

:

: You need a database authentication system.

: You need to store the user name in a db with a column that gets set to 1

say

: when they are logged in.

: When a user tries to login you look for this column to see if it set to 1

or

: not.

: The problem comes when they don't log out properly. So I guess its some

: combination of session variables and a db to store the details.

:

:

: >From: akif noor <akifnoor@y...>

: >Reply-To: "ASP Forms" <asp_forms@p...>

: >To: "ASP Forms" <asp_forms@p...>

: >Subject: [asp_forms] Re: Multiple Logins Problem

: >Date: Wed, 27 Feb 2002 03:18:47 -0800 (PST)

: >

: >I have tried the solution of session variables.

: >but if u can explain in detail it will be easy for me

: >

: >Bye

: >akif noor

: >

: >--- Bharat Saboo <bharatsaboo@h...> wrote:

: > > try using session variables

: > >

: > > bharat

: > >

: > >

: > > >From: akifnoor@y...

: > > >Reply-To: "ASP Forms" <asp_forms@p...>

: > > >To: "ASP Forms" <asp_forms@p...>

: > > >Subject: [asp_forms] Multiple Logins Problem

: > > >Date: Wed, 27 Feb 2002 10:48:55

: > > >

: > > >I have developed a site and from our client we have

: > > a requirement that

: > > >at any time only one user can be log in to the

: > > server with the same

: > > >user name.

: > > >

: > > >it means

: > > >

: > > >same user can't log in from different machines.

: > > >

: > > >if one user is log in from one machine it can't be

: > > >log in from any other machine till first user is

: > > logged off.

: > > >

: > > >if any body have some idea plz share with me .

: > > >thanks

: > > >akif noor





: > > $subst('Email.Unsub').

: > >

: > >

: > >

: >_________________________________________________________________

: > > Send and receive Hotmail on your mobile device:

: > > http://mobile.msn.com

: > >

: > >





: >$subst('Email.Unsub').

: >

: >

: >=====

: >

: >

: >__________________________________________________

: >Do You Yahoo!?

: >Yahoo! Greetings - Send FREE e-cards for every occasion!

: >http://greetings.yahoo.com

: >




:

:

: _________________________________________________________________

: Chat with friends online, try MSN Messenger: http://messenger.msn.com

:

:

:





Message #7 by Oleg Kapeljushnik <c-oleg.kapeljushnik@w...> on Wed, 27 Feb 2002 10:26:08 -0500
Hi !

I have a website that verify that only one user is logged on at the same

time.

What I do is follow :



1. Once user logging on I create a file called <USERNAME>.usr.

   This file includes 2 lines.

	1) IP of logged user

	2) Datetime stamp.



2. Like Daniels said, I am using onUnload Method to call a page called

Logoff.asp.

	What this page is doing is just deleting <USERNAME>.usr file and also

closing my session.

	Actually its ending my session an by that Session_onEnd method is called

(in global.asa)

	I delete the user file in this method.



3. When user trying to log on I check next.

	1. If no file exist then its a first user so we create a file with a data

in it.

	2. If file exist then user in use so I do another check.

	3. If logged on user and user that trying to logon have the same IP

		If yes then log user in since he probably closed window or exit

application 			      improperly.

		If no send message that user in Use.

	4. I use time stamp check logon time difference in case IP are different.

Cause what can happened in my case that user forgot to logoff at home but

then trying to 	logon from home and he couldn't. So if difference here more

that lets say hour then let user 	logon.



I guess its not perfect algorithm but that what I found that works for me. I

didn't want to use DB for this purpose like David says cause I cant be sure

that user logged off correctly and in case user locked system administrator

always can unlock the user by just deleting this file.



This my idea anyway and if somebody here have any suggestions to improve it

let me know.



Thanks,

Oleg.



-----Original Message-----

From: Daniel [mailto:daniel@o...]

Sent: February 27, 2002 7:26 AM

To: ASP Forms

Subject: [asp_forms] Re: Multiple Logins Problem





building on this...

if you use te database like david has mentioned (which i think is the most

scaleable method) you will have a legitmante problem with users not logging

out and cleaning up. so to fix this problem, or somewhat fix it, when you

havigate to the login page, after login is succeeded, popup a new window.

now you have control of that window. then in that new window that you

opened, have a frameset, with only 2 frames, the top one will contain your

pages, and the bottom one will only be 1px tall, then in the frameset page

set the onunload event to call a function from the parent window

(window.opener.functionname) the function in the parent window will clean up

the user info, now you also should have a button that will call this same

function. but this will cause problems if they log out and then it will try

to log out automatically. so then set a variable on the parent window page

to = 1 if they logged out, or leave it to 0 if not, then in the function you

can test and only have the onunload event call the function if the value is

= 0.



this is all just coming from my brain.. and i havnt tested.. but try it out.

the onunload event may or may not work.. but let us know!



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"David Slater" <proc_dev@h...> wrote in message

news:151043@a..._forms...

:

: You need a database authentication system.

: You need to store the user name in a db with a column that gets set to 1

say

: when they are logged in.

: When a user tries to login you look for this column to see if it set to 1

or

: not.

: The problem comes when they don't log out properly. So I guess its some

: combination of session variables and a db to store the details.

:

:

: >From: akif noor <akifnoor@y...>

: >Reply-To: "ASP Forms" <asp_forms@p...>

: >To: "ASP Forms" <asp_forms@p...>

: >Subject: [asp_forms] Re: Multiple Logins Problem

: >Date: Wed, 27 Feb 2002 03:18:47 -0800 (PST)

: >

: >I have tried the solution of session variables.

: >but if u can explain in detail it will be easy for me

: >

: >Bye

: >akif noor

: >

: >--- Bharat Saboo <bharatsaboo@h...> wrote:

: > > try using session variables

: > >

: > > bharat

: > >

: > >

: > > >From: akifnoor@y...

: > > >Reply-To: "ASP Forms" <asp_forms@p...>

: > > >To: "ASP Forms" <asp_forms@p...>

: > > >Subject: [asp_forms] Multiple Logins Problem

: > > >Date: Wed, 27 Feb 2002 10:48:55

: > > >

: > > >I have developed a site and from our client we have

: > > a requirement that

: > > >at any time only one user can be log in to the

: > > server with the same

: > > >user name.

: > > >

: > > >it means

: > > >

: > > >same user can't log in from different machines.

: > > >

: > > >if one user is log in from one machine it can't be

: > > >log in from any other machine till first user is

: > > logged off.

: > > >

: > > >if any body have some idea plz share with me .

: > > >thanks

: > > >akif noor





: > > $subst('Email.Unsub').

: > >

: > >

: > >

: >_________________________________________________________________

: > > Send and receive Hotmail on your mobile device:

: > > http://mobile.msn.com

: > >

: > >





: >$subst('Email.Unsub').

: >

: >

: >=====

: >

: >

: >__________________________________________________

: >Do You Yahoo!?

: >Yahoo! Greetings - Send FREE e-cards for every occasion!

: >http://greetings.yahoo.com

: >




$subst('Email.Unsub').

:

:

: _________________________________________________________________

: Chat with friends online, try MSN Messenger: http://messenger.msn.com

:

:

:












Message #8 by "David Slater" <proc_dev@h...> on Thu, 28 Feb 2002 11:29:30 +0000
Sounds pretty good to me.

It wouldn't work in my environment as I can't write a file. I like your idea 

as well Daniel I hadn't thought of that.





>From: Oleg Kapeljushnik <c-oleg.kapeljushnik@w...>

>Reply-To: "ASP Forms" <asp_forms@p...>

>To: "ASP Forms" <asp_forms@p...>

>Subject: [asp_forms] Re: Multiple Logins Problem

>Date: Wed, 27 Feb 2002 10:26:08 -0500

>

>Hi !

>I have a website that verify that only one user is logged on at the same

>time.

>What I do is follow :

>

>1. Once user logging on I create a file called <USERNAME>.usr.

>    This file includes 2 lines.

>	1) IP of logged user

>	2) Datetime stamp.

>

>2. Like Daniels said, I am using onUnload Method to call a page called

>Logoff.asp.

>	What this page is doing is just deleting <USERNAME>.usr file and also

>closing my session.

>	Actually its ending my session an by that Session_onEnd method is called

>(in global.asa)

>	I delete the user file in this method.

>

>3. When user trying to log on I check next.

>	1. If no file exist then its a first user so we create a file with a data

>in it.

>	2. If file exist then user in use so I do another check.

>	3. If logged on user and user that trying to logon have the same IP

>		If yes then log user in since he probably closed window or exit

>application 			      improperly.

>		If no send message that user in Use.

>	4. I use time stamp check logon time difference in case IP are different.

>Cause what can happened in my case that user forgot to logoff at home but

>then trying to 	logon from home and he couldn't. So if difference here more

>that lets say hour then let user 	logon.

>

>I guess its not perfect algorithm but that what I found that works for me. 

>I

>didn't want to use DB for this purpose like David says cause I cant be sure

>that user logged off correctly and in case user locked system administrator

>always can unlock the user by just deleting this file.

>

>This my idea anyway and if somebody here have any suggestions to improve it

>let me know.

>

>Thanks,

>Oleg.

>

>-----Original Message-----

>From: Daniel [mailto:daniel@o...]

>Sent: February 27, 2002 7:26 AM

>To: ASP Forms

>Subject: [asp_forms] Re: Multiple Logins Problem

>

>

>building on this...

>if you use te database like david has mentioned (which i think is the most

>scaleable method) you will have a legitmante problem with users not logging

>out and cleaning up. so to fix this problem, or somewhat fix it, when you

>havigate to the login page, after login is succeeded, popup a new window.

>now you have control of that window. then in that new window that you

>opened, have a frameset, with only 2 frames, the top one will contain your

>pages, and the bottom one will only be 1px tall, then in the frameset page

>set the onunload event to call a function from the parent window

>(window.opener.functionname) the function in the parent window will clean 

>up

>the user info, now you also should have a button that will call this same

>function. but this will cause problems if they log out and then it will try

>to log out automatically. so then set a variable on the parent window page

>to = 1 if they logged out, or leave it to 0 if not, then in the function 

>you

>can test and only have the onunload event call the function if the value is

>= 0.

>

>this is all just coming from my brain.. and i havnt tested.. but try it 

>out.

>the onunload event may or may not work.. but let us know!

>

>daniel

>

>--

>-----------------------------

>Daniel O'Dorisio

>daniel@o...

>www.odorisio-networks.com

>-----------------------------

>"David Slater" <proc_dev@h...> wrote in message

>news:151043@a..._forms...

>:

>: You need a database authentication system.

>: You need to store the user name in a db with a column that gets set to 1

>say

>: when they are logged in.

>: When a user tries to login you look for this column to see if it set to 1

>or

>: not.

>: The problem comes when they don't log out properly. So I guess its some

>: combination of session variables and a db to store the details.

>:

>:

>: >From: akif noor <akifnoor@y...>

>: >Reply-To: "ASP Forms" <asp_forms@p...>

>: >To: "ASP Forms" <asp_forms@p...>

>: >Subject: [asp_forms] Re: Multiple Logins Problem

>: >Date: Wed, 27 Feb 2002 03:18:47 -0800 (PST)

>: >

>: >I have tried the solution of session variables.

>: >but if u can explain in detail it will be easy for me

>: >

>: >Bye

>: >akif noor

>: >

>: >--- Bharat Saboo <bharatsaboo@h...> wrote:

>: > > try using session variables

>: > >

>: > > bharat

>: > >

>: > >

>: > > >From: akifnoor@y...

>: > > >Reply-To: "ASP Forms" <asp_forms@p...>

>: > > >To: "ASP Forms" <asp_forms@p...>

>: > > >Subject: [asp_forms] Multiple Logins Problem

>: > > >Date: Wed, 27 Feb 2002 10:48:55

>: > > >

>: > > >I have developed a site and from our client we have

>: > > a requirement that

>: > > >at any time only one user can be log in to the

>: > > server with the same

>: > > >user name.

>: > > >

>: > > >it means

>: > > >

>: > > >same user can't log in from different machines.

>: > > >

>: > > >if one user is log in from one machine it can't be

>: > > >log in from any other machine till first user is

>: > > logged off.

>: > > >

>: > > >if any body have some idea plz share with me .

>: > > >thanks

>: > > >akif noor





>: > > $subst('Email.Unsub').

>: > >

>: > >

>: > >

>: >_________________________________________________________________

>: > > Send and receive Hotmail on your mobile device:

>: > > http://mobile.msn.com

>: > >

>: > >





>: >$subst('Email.Unsub').

>: >

>: >

>: >=====

>: >

>: >

>: >__________________________________________________

>: >Do You Yahoo!?

>: >Yahoo! Greetings - Send FREE e-cards for every occasion!

>: >http://greetings.yahoo.com

>: >




>$subst('Email.Unsub').

>:

>:

>: _________________________________________________________________

>: Chat with friends online, try MSN Messenger: http://messenger.msn.com

>:

>:

>:

>

>

>




>

>








_________________________________________________________________

Chat with friends online, try MSN Messenger: http://messenger.msn.com



Message #9 by "Daniel" <daniel@o...> on Thu, 28 Feb 2002 07:10:51 -0500
like it.. the ip stuff helps with the problem of not logging out. im not

sure i can say i like the files 100%, but i assume it would be about the

same performance as using a database. i do like the fact taht the admin can

delete them easily. heck you could even make a pretty GUI for it:-) list all

the users that are logged in, their ip address the date, let the admin

select one and click force logout and use fso to kill the user:-) ok.. i do

like it Oleg:-)



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"Oleg Kapeljushnik" <c-oleg.kapeljushnik@w...> wrote in message

news:151153@a..._forms...

:

: Hi !

: I have a website that verify that only one user is logged on at the same

: time.

: What I do is follow :

:

: 1. Once user logging on I create a file called <USERNAME>.usr.

:    This file includes 2 lines.

: 1) IP of logged user

: 2) Datetime stamp.

:

: 2. Like Daniels said, I am using onUnload Method to call a page called

: Logoff.asp.

: What this page is doing is just deleting <USERNAME>.usr file and also

: closing my session.

: Actually its ending my session an by that Session_onEnd method is called

: (in global.asa)

: I delete the user file in this method.

:

: 3. When user trying to log on I check next.

: 1. If no file exist then its a first user so we create a file with a data

: in it.

: 2. If file exist then user in use so I do another check.

: 3. If logged on user and user that trying to logon have the same IP

: If yes then log user in since he probably closed window or exit

: application       improperly.

: If no send message that user in Use.

: 4. I use time stamp check logon time difference in case IP are different.

: Cause what can happened in my case that user forgot to logoff at home but

: then trying to logon from home and he couldn't. So if difference here more

: that lets say hour then let user logon.

:

: I guess its not perfect algorithm but that what I found that works for me.

I

: didn't want to use DB for this purpose like David says cause I cant be

sure

: that user logged off correctly and in case user locked system

administrator

: always can unlock the user by just deleting this file.

:

: This my idea anyway and if somebody here have any suggestions to improve

it

: let me know.

:

: Thanks,

: Oleg.

:

: -----Original Message-----

: From: Daniel [mailto:daniel@o...]

: Sent: February 27, 2002 7:26 AM

: To: ASP Forms

: Subject: [asp_forms] Re: Multiple Logins Problem

:

:

: building on this...

: if you use te database like david has mentioned (which i think is the most

: scaleable method) you will have a legitmante problem with users not

logging

: out and cleaning up. so to fix this problem, or somewhat fix it, when you

: havigate to the login page, after login is succeeded, popup a new window.

: now you have control of that window. then in that new window that you

: opened, have a frameset, with only 2 frames, the top one will contain your

: pages, and the bottom one will only be 1px tall, then in the frameset page

: set the onunload event to call a function from the parent window

: (window.opener.functionname) the function in the parent window will clean

up

: the user info, now you also should have a button that will call this same

: function. but this will cause problems if they log out and then it will

try

: to log out automatically. so then set a variable on the parent window page

: to = 1 if they logged out, or leave it to 0 if not, then in the function

you

: can test and only have the onunload event call the function if the value

is

: = 0.

:

: this is all just coming from my brain.. and i havnt tested.. but try it

out.

: the onunload event may or may not work.. but let us know!

:

: daniel

:

: --

: -----------------------------

: Daniel O'Dorisio

: daniel@o...

: www.odorisio-networks.com

: -----------------------------

: "David Slater" <proc_dev@h...> wrote in message

: news:151043@a..._forms...

: :

: : You need a database authentication system.

: : You need to store the user name in a db with a column that gets set to 1

: say

: : when they are logged in.

: : When a user tries to login you look for this column to see if it set to

1

: or

: : not.

: : The problem comes when they don't log out properly. So I guess its some

: : combination of session variables and a db to store the details.

: :

: :

: : >From: akif noor <akifnoor@y...>

: : >Reply-To: "ASP Forms" <asp_forms@p...>

: : >To: "ASP Forms" <asp_forms@p...>

: : >Subject: [asp_forms] Re: Multiple Logins Problem

: : >Date: Wed, 27 Feb 2002 03:18:47 -0800 (PST)

: : >

: : >I have tried the solution of session variables.

: : >but if u can explain in detail it will be easy for me

: : >

: : >Bye

: : >akif noor

: : >

: : >--- Bharat Saboo <bharatsaboo@h...> wrote:

: : > > try using session variables

: : > >

: : > > bharat

: : > >

: : > >

: : > > >From: akifnoor@y...

: : > > >Reply-To: "ASP Forms" <asp_forms@p...>

: : > > >To: "ASP Forms" <asp_forms@p...>

: : > > >Subject: [asp_forms] Multiple Logins Problem

: : > > >Date: Wed, 27 Feb 2002 10:48:55

: : > > >

: : > > >I have developed a site and from our client we have

: : > > a requirement that

: : > > >at any time only one user can be log in to the

: : > > server with the same

: : > > >user name.

: : > > >

: : > > >it means

: : > > >

: : > > >same user can't log in from different machines.

: : > > >

: : > > >if one user is log in from one machine it can't be

: : > > >log in from any other machine till first user is

: : > > logged off.

: : > > >

: : > > >if any body have some idea plz share with me .

: : > > >thanks

: : > > >akif noor





: : > > $subst('Email.Unsub').

: : > >

: : > >

: : > >

: : >_________________________________________________________________

: : > > Send and receive Hotmail on your mobile device:

: : > > http://mobile.msn.com

: : > >

: : > >





: : >$subst('Email.Unsub').

: : >

: : >

: : >=====

: : >

: : >

: : >__________________________________________________

: : >Do You Yahoo!?

: : >Yahoo! Greetings - Send FREE e-cards for every occasion!

: : >http://greetings.yahoo.com

: : >




: $subst('Email.Unsub').

: :

: :

: : _________________________________________________________________

: : Chat with friends online, try MSN Messenger: http://messenger.msn.com

: :

: :

: :

:

:

:




:

:

:





Message #10 by Brent Latham <Brent2@w...> on Thu, 28 Feb 2002 12:18:27 -0000
There is no difference from using a database than using a file!



The only difference is that you are creating a file rather than a record!



Personally I believe the database would be far more efficient than 

using a file! Your creating a file just to hold a little bit of info!



Slightly overkill!



Cheers

Brent





-----Original Message-----

From: Daniel [mailto:daniel@o...]

Sent: 28 February 2002 12:11

To: ASP Forms

Subject: [asp_forms] Re: Multiple Logins Problem





like it.. the ip stuff helps with the problem of not logging out. im not

sure i can say i like the files 100%, but i assume it would be about the

same performance as using a database. i do like the fact taht the admin can

delete them easily. heck you could even make a pretty GUI for it:-) list all

the users that are logged in, their ip address the date, let the admin

select one and click force logout and use fso to kill the user:-) ok.. i do

like it Oleg:-)



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"Oleg Kapeljushnik" <c-oleg.kapeljushnik@w...> wrote in message

news:151153@a..._forms...

:

: Hi !

: I have a website that verify that only one user is logged on at the same

: time.

: What I do is follow :

:

: 1. Once user logging on I create a file called <USERNAME>.usr.

:    This file includes 2 lines.

: 1) IP of logged user

: 2) Datetime stamp.

:

: 2. Like Daniels said, I am using onUnload Method to call a page called

: Logoff.asp.

: What this page is doing is just deleting <USERNAME>.usr file and also

: closing my session.

: Actually its ending my session an by that Session_onEnd method is called

: (in global.asa)

: I delete the user file in this method.

:

: 3. When user trying to log on I check next.

: 1. If no file exist then its a first user so we create a file with a data

: in it.

: 2. If file exist then user in use so I do another check.

: 3. If logged on user and user that trying to logon have the same IP

: If yes then log user in since he probably closed window or exit

: application       improperly.

: If no send message that user in Use.

: 4. I use time stamp check logon time difference in case IP are different.

: Cause what can happened in my case that user forgot to logoff at home but

: then trying to logon from home and he couldn't. So if difference here more

: that lets say hour then let user logon.

:

: I guess its not perfect algorithm but that what I found that works for me.

I

: didn't want to use DB for this purpose like David says cause I cant be

sure

: that user logged off correctly and in case user locked system

administrator

: always can unlock the user by just deleting this file.

:

: This my idea anyway and if somebody here have any suggestions to improve

it

: let me know.

:

: Thanks,

: Oleg.

:

: -----Original Message-----

: From: Daniel [mailto:daniel@o...]

: Sent: February 27, 2002 7:26 AM

: To: ASP Forms

: Subject: [asp_forms] Re: Multiple Logins Problem

:

:

: building on this...

: if you use te database like david has mentioned (which i think is the most

: scaleable method) you will have a legitmante problem with users not

logging

: out and cleaning up. so to fix this problem, or somewhat fix it, when you

: havigate to the login page, after login is succeeded, popup a new window.

: now you have control of that window. then in that new window that you

: opened, have a frameset, with only 2 frames, the top one will contain your

: pages, and the bottom one will only be 1px tall, then in the frameset page

: set the onunload event to call a function from the parent window

: (window.opener.functionname) the function in the parent window will clean

up

: the user info, now you also should have a button that will call this same

: function. but this will cause problems if they log out and then it will

try

: to log out automatically. so then set a variable on the parent window page

: to = 1 if they logged out, or leave it to 0 if not, then in the function

you

: can test and only have the onunload event call the function if the value

is

: = 0.

:

: this is all just coming from my brain.. and i havnt tested.. but try it

out.

: the onunload event may or may not work.. but let us know!

:

: daniel

:

: --

: -----------------------------

: Daniel O'Dorisio

: daniel@o...

: www.odorisio-networks.com

: -----------------------------

: "David Slater" <proc_dev@h...> wrote in message

: news:151043@a..._forms...

: :

: : You need a database authentication system.

: : You need to store the user name in a db with a column that gets set to 1

: say

: : when they are logged in.

: : When a user tries to login you look for this column to see if it set to

1

: or

: : not.

: : The problem comes when they don't log out properly. So I guess its some

: : combination of session variables and a db to store the details.

: :

: :

: : >From: akif noor <akifnoor@y...>

: : >Reply-To: "ASP Forms" <asp_forms@p...>

: : >To: "ASP Forms" <asp_forms@p...>

: : >Subject: [asp_forms] Re: Multiple Logins Problem

: : >Date: Wed, 27 Feb 2002 03:18:47 -0800 (PST)

: : >

: : >I have tried the solution of session variables.

: : >but if u can explain in detail it will be easy for me

: : >

: : >Bye

: : >akif noor

: : >

: : >--- Bharat Saboo <bharatsaboo@h...> wrote:

: : > > try using session variables

: : > >

: : > > bharat

: : > >

: : > >

: : > > >From: akifnoor@y...

: : > > >Reply-To: "ASP Forms" <asp_forms@p...>

: : > > >To: "ASP Forms" <asp_forms@p...>

: : > > >Subject: [asp_forms] Multiple Logins Problem

: : > > >Date: Wed, 27 Feb 2002 10:48:55

: : > > >

: : > > >I have developed a site and from our client we have

: : > > a requirement that

: : > > >at any time only one user can be log in to the

: : > > server with the same

: : > > >user name.

: : > > >

: : > > >it means

: : > > >

: : > > >same user can't log in from different machines.

: : > > >

: : > > >if one user is log in from one machine it can't be

: : > > >log in from any other machine till first user is

: : > > logged off.

: : > > >

: : > > >if any body have some idea plz share with me .

: : > > >thanks

: : > > >akif noor





: : > > $subst('Email.Unsub').

: : > >

: : > >

: : > >

: : >_________________________________________________________________

: : > > Send and receive Hotmail on your mobile device:

: : > > http://mobile.msn.com

: : > >

: : > >





: : >$subst('Email.Unsub').

: : >

: : >

: : >=====

: : >

: : >

: : >__________________________________________________

: : >Do You Yahoo!?

: : >Yahoo! Greetings - Send FREE e-cards for every occasion!

: : >http://greetings.yahoo.com

: : >




: $subst('Email.Unsub').

: :

: :

: : _________________________________________________________________

: : Chat with friends online, try MSN Messenger: http://messenger.msn.com

: :

: :

: :

:

:

:




:

:

:










Message #11 by "Daniel" <daniel@o...> on Thu, 28 Feb 2002 07:25:44 -0500
yeah the idea of the file seems like overkill.. but it sure would simplify

the admin killing the correct user.



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"Brent Latham" <Brent2@w...> wrote in message

news:151528@a..._forms...

:

: There is no difference from using a database than using a file!

:

: The only difference is that you are creating a file rather than a record!

:

: Personally I believe the database would be far more efficient than

: using a file! Your creating a file just to hold a little bit of info!

:

: Slightly overkill!

:

: Cheers

: Brent

:

:

: -----Original Message-----

: From: Daniel [mailto:daniel@o...]

: Sent: 28 February 2002 12:11

: To: ASP Forms

: Subject: [asp_forms] Re: Multiple Logins Problem

:

:

: like it.. the ip stuff helps with the problem of not logging out. im not

: sure i can say i like the files 100%, but i assume it would be about the

: same performance as using a database. i do like the fact taht the admin

can

: delete them easily. heck you could even make a pretty GUI for it:-) list

all

: the users that are logged in, their ip address the date, let the admin

: select one and click force logout and use fso to kill the user:-) ok.. i

do

: like it Oleg:-)

:

: daniel

:

: --

: -----------------------------

: Daniel O'Dorisio

: daniel@o...

: www.odorisio-networks.com

: -----------------------------

: "Oleg Kapeljushnik" <c-oleg.kapeljushnik@w...> wrote in message

: news:151153@a..._forms...

: :

: : Hi !

: : I have a website that verify that only one user is logged on at the same

: : time.

: : What I do is follow :

: :

: : 1. Once user logging on I create a file called <USERNAME>.usr.

: :    This file includes 2 lines.

: : 1) IP of logged user

: : 2) Datetime stamp.

: :

: : 2. Like Daniels said, I am using onUnload Method to call a page called

: : Logoff.asp.

: : What this page is doing is just deleting <USERNAME>.usr file and also

: : closing my session.

: : Actually its ending my session an by that Session_onEnd method is called

: : (in global.asa)

: : I delete the user file in this method.

: :

: : 3. When user trying to log on I check next.

: : 1. If no file exist then its a first user so we create a file with a

data

: : in it.

: : 2. If file exist then user in use so I do another check.

: : 3. If logged on user and user that trying to logon have the same IP

: : If yes then log user in since he probably closed window or exit

: : application       improperly.

: : If no send message that user in Use.

: : 4. I use time stamp check logon time difference in case IP are

different.

: : Cause what can happened in my case that user forgot to logoff at home

but

: : then trying to logon from home and he couldn't. So if difference here

more

: : that lets say hour then let user logon.

: :

: : I guess its not perfect algorithm but that what I found that works for

me.

: I

: : didn't want to use DB for this purpose like David says cause I cant be

: sure

: : that user logged off correctly and in case user locked system

: administrator

: : always can unlock the user by just deleting this file.

: :

: : This my idea anyway and if somebody here have any suggestions to improve

: it

: : let me know.

: :

: : Thanks,

: : Oleg.

: :

: : -----Original Message-----

: : From: Daniel [mailto:daniel@o...]

: : Sent: February 27, 2002 7:26 AM

: : To: ASP Forms

: : Subject: [asp_forms] Re: Multiple Logins Problem

: :

: :

: : building on this...

: : if you use te database like david has mentioned (which i think is the

most

: : scaleable method) you will have a legitmante problem with users not

: logging

: : out and cleaning up. so to fix this problem, or somewhat fix it, when

you

: : havigate to the login page, after login is succeeded, popup a new

window.

: : now you have control of that window. then in that new window that you

: : opened, have a frameset, with only 2 frames, the top one will contain

your

: : pages, and the bottom one will only be 1px tall, then in the frameset

page

: : set the onunload event to call a function from the parent window

: : (window.opener.functionname) the function in the parent window will

clean

: up

: : the user info, now you also should have a button that will call this

same

: : function. but this will cause problems if they log out and then it will

: try

: : to log out automatically. so then set a variable on the parent window

page

: : to = 1 if they logged out, or leave it to 0 if not, then in the function

: you

: : can test and only have the onunload event call the function if the value

: is

: : = 0.

: :

: : this is all just coming from my brain.. and i havnt tested.. but try it

: out.

: : the onunload event may or may not work.. but let us know!

: :

: : daniel

: :

: : --

: : -----------------------------

: : Daniel O'Dorisio

: : daniel@o...

: : www.odorisio-networks.com

: : -----------------------------

: : "David Slater" <proc_dev@h...> wrote in message

: : news:151043@a..._forms...

: : :

: : : You need a database authentication system.

: : : You need to store the user name in a db with a column that gets set to

1

: : say

: : : when they are logged in.

: : : When a user tries to login you look for this column to see if it set

to

: 1

: : or

: : : not.

: : : The problem comes when they don't log out properly. So I guess its

some

: : : combination of session variables and a db to store the details.

: : :

: : :

: : : >From: akif noor <akifnoor@y...>

: : : >Reply-To: "ASP Forms" <asp_forms@p...>

: : : >To: "ASP Forms" <asp_forms@p...>

: : : >Subject: [asp_forms] Re: Multiple Logins Problem

: : : >Date: Wed, 27 Feb 2002 03:18:47 -0800 (PST)

: : : >

: : : >I have tried the solution of session variables.

: : : >but if u can explain in detail it will be easy for me

: : : >

: : : >Bye

: : : >akif noor

: : : >

: : : >--- Bharat Saboo <bharatsaboo@h...> wrote:

: : : > > try using session variables

: : : > >

: : : > > bharat

: : : > >

: : : > >

: : : > > >From: akifnoor@y...

: : : > > >Reply-To: "ASP Forms" <asp_forms@p...>

: : : > > >To: "ASP Forms" <asp_forms@p...>

: : : > > >Subject: [asp_forms] Multiple Logins Problem

: : : > > >Date: Wed, 27 Feb 2002 10:48:55

: : : > > >

: : : > > >I have developed a site and from our client we have

: : : > > a requirement that

: : : > > >at any time only one user can be log in to the

: : : > > server with the same

: : : > > >user name.

: : : > > >

: : : > > >it means

: : : > > >

: : : > > >same user can't log in from different machines.

: : : > > >

: : : > > >if one user is log in from one machine it can't be

: : : > > >log in from any other machine till first user is

: : : > > logged off.

: : : > > >

: : : > > >if any body have some idea plz share with me .

: : : > > >thanks

: : : > > >akif noor





: : : > > $subst('Email.Unsub').

: : : > >

: : : > >

: : : > >

: : : >_________________________________________________________________

: : : > > Send and receive Hotmail on your mobile device:

: : : > > http://mobile.msn.com

: : : > >

: : : > >





: : : >$subst('Email.Unsub').

: : : >

: : : >

: : : >=====

: : : >

: : : >

: : : >__________________________________________________

: : : >Do You Yahoo!?

: : : >Yahoo! Greetings - Send FREE e-cards for every occasion!

: : : >http://greetings.yahoo.com

: : : >




: : $subst('Email.Unsub').

: : :

: : :

: : : _________________________________________________________________

: : : Chat with friends online, try MSN Messenger: http://messenger.msn.com

: : :

: : :

: : :

: :

: :

: :




: :

: :

: :

:

:

:




:

:





Message #12 by Oleg Kapeljushnik <c-oleg.kapeljushnik@w...> on Thu, 28 Feb 2002 09:07:33 -0500
Yes,

I am using the file to simplify administration.



I could use the DB and that's what I was thinking in the beginning but

then we run into problem that some times the user is locked up and sys admin

that have no idea about DB

have to release them.



I could right some tool for this, like release users that would work with DB

but I guess either I was lazy that time

or I also had some other consideration that I don't remember it right now.



Oleg.



-----Original Message-----

From: Daniel [mailto:daniel@o...]

Sent: February 28, 2002 7:26 AM

To: ASP Forms

Subject: [asp_forms] Re: Multiple Logins Problem





yeah the idea of the file seems like overkill.. but it sure would simplify

the admin killing the correct user.



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"Brent Latham" <Brent2@w...> wrote in message

news:151528@a..._forms...

:

: There is no difference from using a database than using a file!

:

: The only difference is that you are creating a file rather than a record!

:

: Personally I believe the database would be far more efficient than

: using a file! Your creating a file just to hold a little bit of info!

:

: Slightly overkill!

:

: Cheers

: Brent

:

:

: -----Original Message-----

: From: Daniel [mailto:daniel@o...]

: Sent: 28 February 2002 12:11

: To: ASP Forms

: Subject: [asp_forms] Re: Multiple Logins Problem

:

:

: like it.. the ip stuff helps with the problem of not logging out. im not

: sure i can say i like the files 100%, but i assume it would be about the

: same performance as using a database. i do like the fact taht the admin

can

: delete them easily. heck you could even make a pretty GUI for it:-) list

all

: the users that are logged in, their ip address the date, let the admin

: select one and click force logout and use fso to kill the user:-) ok.. i

do

: like it Oleg:-)

:

: daniel

:

: --

: -----------------------------

: Daniel O'Dorisio

: daniel@o...

: www.odorisio-networks.com

: -----------------------------

: "Oleg Kapeljushnik" <c-oleg.kapeljushnik@w...> wrote in message

: news:151153@a..._forms...

: :

: : Hi !

: : I have a website that verify that only one user is logged on at the same

: : time.

: : What I do is follow :

: :

: : 1. Once user logging on I create a file called <USERNAME>.usr.

: :    This file includes 2 lines.

: : 1) IP of logged user

: : 2) Datetime stamp.

: :

: : 2. Like Daniels said, I am using onUnload Method to call a page called

: : Logoff.asp.

: : What this page is doing is just deleting <USERNAME>.usr file and also

: : closing my session.

: : Actually its ending my session an by that Session_onEnd method is called

: : (in global.asa)

: : I delete the user file in this method.

: :

: : 3. When user trying to log on I check next.

: : 1. If no file exist then its a first user so we create a file with a

data

: : in it.

: : 2. If file exist then user in use so I do another check.

: : 3. If logged on user and user that trying to logon have the same IP

: : If yes then log user in since he probably closed window or exit

: : application       improperly.

: : If no send message that user in Use.

: : 4. I use time stamp check logon time difference in case IP are

different.

: : Cause what can happened in my case that user forgot to logoff at home

but

: : then trying to logon from home and he couldn't. So if difference here

more

: : that lets say hour then let user logon.

: :

: : I guess its not perfect algorithm but that what I found that works for

me.

: I

: : didn't want to use DB for this purpose like David says cause I cant be

: sure

: : that user logged off correctly and in case user locked system

: administrator

: : always can unlock the user by just deleting this file.

: :

: : This my idea anyway and if somebody here have any suggestions to improve

: it

: : let me know.

: :

: : Thanks,

: : Oleg.

: :

: : -----Original Message-----

: : From: Daniel [mailto:daniel@o...]

: : Sent: February 27, 2002 7:26 AM

: : To: ASP Forms

: : Subject: [asp_forms] Re: Multiple Logins Problem

: :

: :

: : building on this...

: : if you use te database like david has mentioned (which i think is the

most

: : scaleable method) you will have a legitmante problem with users not

: logging

: : out and cleaning up. so to fix this problem, or somewhat fix it, when

you

: : havigate to the login page, after login is succeeded, popup a new

window.

: : now you have control of that window. then in that new window that you

: : opened, have a frameset, with only 2 frames, the top one will contain

your

: : pages, and the bottom one will only be 1px tall, then in the frameset

page

: : set the onunload event to call a function from the parent window

: : (window.opener.functionname) the function in the parent window will

clean

: up

: : the user info, now you also should have a button that will call this

same

: : function. but this will cause problems if they log out and then it will

: try

: : to log out automatically. so then set a variable on the parent window

page

: : to = 1 if they logged out, or leave it to 0 if not, then in the function

: you

: : can test and only have the onunload event call the function if the value

: is

: : = 0.

: :

: : this is all just coming from my brain.. and i havnt tested.. but try it

: out.

: : the onunload event may or may not work.. but let us know!

: :

: : daniel

: :

: : --

: : -----------------------------

: : Daniel O'Dorisio

: : daniel@o...

: : www.odorisio-networks.com

: : -----------------------------

: : "David Slater" <proc_dev@h...> wrote in message

: : news:151043@a..._forms...

: : :

: : : You need a database authentication system.

: : : You need to store the user name in a db with a column that gets set to

1

: : say

: : : when they are logged in.

: : : When a user tries to login you look for this column to see if it set

to

: 1

: : or

: : : not.

: : : The problem comes when they don't log out properly. So I guess its

some

: : : combination of session variables and a db to store the details.

: : :

: : :

: : : >From: akif noor <akifnoor@y...>

: : : >Reply-To: "ASP Forms" <asp_forms@p...>

: : : >To: "ASP Forms" <asp_forms@p...>

: : : >Subject: [asp_forms] Re: Multiple Logins Problem

: : : >Date: Wed, 27 Feb 2002 03:18:47 -0800 (PST)

: : : >

: : : >I have tried the solution of session variables.

: : : >but if u can explain in detail it will be easy for me

: : : >

: : : >Bye

: : : >akif noor

: : : >

: : : >--- Bharat Saboo <bharatsaboo@h...> wrote:

: : : > > try using session variables

: : : > >

: : : > > bharat

: : : > >

: : : > >

: : : > > >From: akifnoor@y...

: : : > > >Reply-To: "ASP Forms" <asp_forms@p...>

: : : > > >To: "ASP Forms" <asp_forms@p...>

: : : > > >Subject: [asp_forms] Multiple Logins Problem

: : : > > >Date: Wed, 27 Feb 2002 10:48:55

: : : > > >

: : : > > >I have developed a site and from our client we have

: : : > > a requirement that

: : : > > >at any time only one user can be log in to the

: : : > > server with the same

: : : > > >user name.

: : : > > >

: : : > > >it means

: : : > > >

: : : > > >same user can't log in from different machines.

: : : > > >

: : : > > >if one user is log in from one machine it can't be

: : : > > >log in from any other machine till first user is

: : : > > logged off.

: : : > > >

: : : > > >if any body have some idea plz share with me .

: : : > > >thanks

: : : > > >akif noor





: : : > > $subst('Email.Unsub').

: : : > >

: : : > >

: : : > >

: : : >_________________________________________________________________

: : : > > Send and receive Hotmail on your mobile device:

: : : > > http://mobile.msn.com

: : : > >

: : : > >





: : : >$subst('Email.Unsub').

: : : >

: : : >

: : : >=====

: : : >

: : : >

: : : >__________________________________________________

: : : >Do You Yahoo!?

: : : >Yahoo! Greetings - Send FREE e-cards for every occasion!

: : : >http://greetings.yahoo.com

: : : >




: : $subst('Email.Unsub').

: : :

: : :

: : : _________________________________________________________________

: : : Chat with friends online, try MSN Messenger: http://messenger.msn.com

: : :

: : :

: : :

: :

: :

: :




$subst('Email.Unsub').

: :

: :

: :

:

:

:




:

:












Message #13 by Brent Latham <Brent2@w...> on Thu, 28 Feb 2002 14:31:17 -0000
Sorry its taken me so long to reply!



>>> but it sure would simplify the admin killing the correct user.



I dissagree!



Lets look at what is happening!



3. When user trying to log on I check next.

1.If no file exist then its a first user so we create a file with a

data

: : in it.

: : 2. If file exist then user in use so I do another check.

: : 3. If logged on user and user that trying to logon have the same IP

: : If yes then log user in since he probably closed window or exit

: : application       improperly.

: : If no send message that user in Use.

: : 4. I use time stamp check logon time difference in case IP are

different.



Think about how much code that is needed there and think about how

much code needed to do the same thing in a dabase table!



You could do all that with one stored procedure which wouldn't pass back

any recordsets at all just the values necessary using the output parameters!



There is no difference between storing the data in files rather than tables!

Its just a different vehicle!  I don't think its a good idea!



Cheers

Brent 







-----Original Message-----

From: Daniel [mailto:daniel@o...]

Sent: 28 February 2002 12:26

To: ASP Forms

Subject: [asp_forms] Re: Multiple Logins Problem





yeah the idea of the file seems like overkill.. but it sure would simplify

the admin killing the correct user.



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"Brent Latham" <Brent2@w...> wrote in message

news:151528@a..._forms...

:

: There is no difference from using a database than using a file!

:

: The only difference is that you are creating a file rather than a record!

:

: Personally I believe the database would be far more efficient than

: using a file! Your creating a file just to hold a little bit of info!

:

: Slightly overkill!

:

: Cheers

: Brent

:

:

: -----Original Message-----

: From: Daniel [mailto:daniel@o...]

: Sent: 28 February 2002 12:11

: To: ASP Forms

: Subject: [asp_forms] Re: Multiple Logins Problem

:

:

: like it.. the ip stuff helps with the problem of not logging out. im not

: sure i can say i like the files 100%, but i assume it would be about the

: same performance as using a database. i do like the fact taht the admin

can

: delete them easily. heck you could even make a pretty GUI for it:-) list

all

: the users that are logged in, their ip address the date, let the admin

: select one and click force logout and use fso to kill the user:-) ok.. i

do

: like it Oleg:-)

:

: daniel

:

: --

: -----------------------------

: Daniel O'Dorisio

: daniel@o...

: www.odorisio-networks.com

: -----------------------------

: "Oleg Kapeljushnik" <c-oleg.kapeljushnik@w...> wrote in message

: news:151153@a..._forms...

: :

: : Hi !

: : I have a website that verify that only one user is logged on at the same

: : time.

: : What I do is follow :

: :

: : 1. Once user logging on I create a file called <USERNAME>.usr.

: :    This file includes 2 lines.

: : 1) IP of logged user

: : 2) Datetime stamp.

: :

: : 2. Like Daniels said, I am using onUnload Method to call a page called

: : Logoff.asp.

: : What this page is doing is just deleting <USERNAME>.usr file and also

: : closing my session.

: : Actually its ending my session an by that Session_onEnd method is called

: : (in global.asa)

: : I delete the user file in this method.

: :

: : 3. When user trying to log on I check next.

: : 1. If no file exist then its a first user so we create a file with a

data

: : in it.

: : 2. If file exist then user in use so I do another check.

: : 3. If logged on user and user that trying to logon have the same IP

: : If yes then log user in since he probably closed window or exit

: : application       improperly.

: : If no send message that user in Use.

: : 4. I use time stamp check logon time difference in case IP are

different.

: : Cause what can happened in my case that user forgot to logoff at home

but

: : then trying to logon from home and he couldn't. So if difference here

more

: : that lets say hour then let user logon.

: :

: : I guess its not perfect algorithm but that what I found that works for

me.

: I

: : didn't want to use DB for this purpose like David says cause I cant be

: sure

: : that user logged off correctly and in case user locked system

: administrator

: : always can unlock the user by just deleting this file.

: :

: : This my idea anyway and if somebody here have any suggestions to improve

: it

: : let me know.

: :

: : Thanks,

: : Oleg.

: :

: : -----Original Message-----

: : From: Daniel [mailto:daniel@o...]

: : Sent: February 27, 2002 7:26 AM

: : To: ASP Forms

: : Subject: [asp_forms] Re: Multiple Logins Problem

: :

: :

: : building on this...

: : if you use te database like david has mentioned (which i think is the

most

: : scaleable method) you will have a legitmante problem with users not

: logging

: : out and cleaning up. so to fix this problem, or somewhat fix it, when

you

: : havigate to the login page, after login is succeeded, popup a new

window.

: : now you have control of that window. then in that new window that you

: : opened, have a frameset, with only 2 frames, the top one will contain

your

: : pages, and the bottom one will only be 1px tall, then in the frameset

page

: : set the onunload event to call a function from the parent window

: : (window.opener.functionname) the function in the parent window will

clean

: up

: : the user info, now you also should have a button that will call this

same

: : function. but this will cause problems if they log out and then it will

: try

: : to log out automatically. so then set a variable on the parent window

page

: : to = 1 if they logged out, or leave it to 0 if not, then in the function

: you

: : can test and only have the onunload event call the function if the value

: is

: : = 0.

: :

: : this is all just coming from my brain.. and i havnt tested.. but try it

: out.

: : the onunload event may or may not work.. but let us know!

: :

: : daniel

: :

: : --

: : -----------------------------

: : Daniel O'Dorisio

: : daniel@o...

: : www.odorisio-networks.com

: : -----------------------------

: : "David Slater" <proc_dev@h...> wrote in message

: : news:151043@a..._forms...

: : :

: : : You need a database authentication system.

: : : You need to store the user name in a db with a column that gets set to

1

: : say

: : : when they are logged in.

: : : When a user tries to login you look for this column to see if it set

to

: 1

: : or

: : : not.

: : : The problem comes when they don't log out properly. So I guess its

some

: : : combination of session variables and a db to store the details.

: : :

: : :

: : : >From: akif noor <akifnoor@y...>

: : : >Reply-To: "ASP Forms" <asp_forms@p...>

: : : >To: "ASP Forms" <asp_forms@p...>

: : : >Subject: [asp_forms] Re: Multiple Logins Problem

: : : >Date: Wed, 27 Feb 2002 03:18:47 -0800 (PST)

: : : >

: : : >I have tried the solution of session variables.

: : : >but if u can explain in detail it will be easy for me

: : : >

: : : >Bye

: : : >akif noor

: : : >

: : : >--- Bharat Saboo <bharatsaboo@h...> wrote:

: : : > > try using session variables

: : : > >

: : : > > bharat

: : : > >

: : : > >

: : : > > >From: akifnoor@y...

: : : > > >Reply-To: "ASP Forms" <asp_forms@p...>

: : : > > >To: "ASP Forms" <asp_forms@p...>

: : : > > >Subject: [asp_forms] Multiple Logins Problem

: : : > > >Date: Wed, 27 Feb 2002 10:48:55

: : : > > >

: : : > > >I have developed a site and from our client we have

: : : > > a requirement that

: : : > > >at any time only one user can be log in to the

: : : > > server with the same

: : : > > >user name.

: : : > > >

: : : > > >it means

: : : > > >

: : : > > >same user can't log in from different machines.

: : : > > >

: : : > > >if one user is log in from one machine it can't be

: : : > > >log in from any other machine till first user is

: : : > > logged off.

: : : > > >

: : : > > >if any body have some idea plz share with me .

: : : > > >thanks

: : : > > >akif noor





: : : > > $subst('Email.Unsub').

: : : > >

: : : > >

: : : > >

: : : >_________________________________________________________________

: : : > > Send and receive Hotmail on your mobile device:

: : : > > http://mobile.msn.com

: : : > >

: : : > >





: : : >$subst('Email.Unsub').

: : : >

: : : >

: : : >=====

: : : >

: : : >

: : : >__________________________________________________

: : : >Do You Yahoo!?

: : : >Yahoo! Greetings - Send FREE e-cards for every occasion!

: : : >http://greetings.yahoo.com

: : : >




: : $subst('Email.Unsub').

: : :

: : :

: : : _________________________________________________________________

: : : Chat with friends online, try MSN Messenger: http://messenger.msn.com

: : :

: : :

: : :

: :

: :

: :




$subst('Email.Unsub').

: :

: :

: :

:

:

:




:

:










Message #14 by Brent Latham <Brent2@w...> on Thu, 28 Feb 2002 14:40:55 -0000
m8 - I wouldn't bother about it now anyway!  It works :)



That is what counts mostly lol



I bet it gave you a lot more experience with files

anyway!



Cheers

Brent



-----Original Message-----

From: Oleg Kapeljushnik [mailto:c-oleg.kapeljushnik@w...]

Sent: 28 February 2002 14:08

To: ASP Forms

Subject: [asp_forms] Re: Multiple Logins Problem





Yes,

I am using the file to simplify administration.



I could use the DB and that's what I was thinking in the beginning but

then we run into problem that some times the user is locked up and sys admin

that have no idea about DB

have to release them.



I could right some tool for this, like release users that would work with DB

but I guess either I was lazy that time

or I also had some other consideration that I don't remember it right now.



Oleg.



-----Original Message-----

From: Daniel [mailto:daniel@o...]

Sent: February 28, 2002 7:26 AM

To: ASP Forms

Subject: [asp_forms] Re: Multiple Logins Problem





yeah the idea of the file seems like overkill.. but it sure would simplify

the admin killing the correct user.



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"Brent Latham" <Brent2@w...> wrote in message

news:151528@a..._forms...

:

: There is no difference from using a database than using a file!

:

: The only difference is that you are creating a file rather than a record!

:

: Personally I believe the database would be far more efficient than

: using a file! Your creating a file just to hold a little bit of info!

:

: Slightly overkill!

:

: Cheers

: Brent

:

:

: -----Original Message-----

: From: Daniel [mailto:daniel@o...]

: Sent: 28 February 2002 12:11

: To: ASP Forms

: Subject: [asp_forms] Re: Multiple Logins Problem

:

:

: like it.. the ip stuff helps with the problem of not logging out. im not

: sure i can say i like the files 100%, but i assume it would be about the

: same performance as using a database. i do like the fact taht the admin

can

: delete them easily. heck you could even make a pretty GUI for it:-) list

all

: the users that are logged in, their ip address the date, let the admin

: select one and click force logout and use fso to kill the user:-) ok.. i

do

: like it Oleg:-)

:

: daniel

:

: --

: -----------------------------

: Daniel O'Dorisio

: daniel@o...

: www.odorisio-networks.com

: -----------------------------

: "Oleg Kapeljushnik" <c-oleg.kapeljushnik@w...> wrote in message

: news:151153@a..._forms...

: :

: : Hi !

: : I have a website that verify that only one user is logged on at the same

: : time.

: : What I do is follow :

: :

: : 1. Once user logging on I create a file called <USERNAME>.usr.

: :    This file includes 2 lines.

: : 1) IP of logged user

: : 2) Datetime stamp.

: :

: : 2. Like Daniels said, I am using onUnload Method to call a page called

: : Logoff.asp.

: : What this page is doing is just deleting <USERNAME>.usr file and also

: : closing my session.

: : Actually its ending my session an by that Session_onEnd method is called

: : (in global.asa)

: : I delete the user file in this method.

: :

: : 3. When user trying to log on I check next.

: : 1. If no file exist then its a first user so we create a file with a

data

: : in it.

: : 2. If file exist then user in use so I do another check.

: : 3. If logged on user and user that trying to logon have the same IP

: : If yes then log user in since he probably closed window or exit

: : application       improperly.

: : If no send message that user in Use.

: : 4. I use time stamp check logon time difference in case IP are

different.

: : Cause what can happened in my case that user forgot to logoff at home

but

: : then trying to logon from home and he couldn't. So if difference here

more

: : that lets say hour then let user logon.

: :

: : I guess its not perfect algorithm but that what I found that works for

me.

: I

: : didn't want to use DB for this purpose like David says cause I cant be

: sure

: : that user logged off correctly and in case user locked system

: administrator

: : always can unlock the user by just deleting this file.

: :

: : This my idea anyway and if somebody here have any suggestions to improve

: it

: : let me know.

: :

: : Thanks,

: : Oleg.

: :

: : -----Original Message-----

: : From: Daniel [mailto:daniel@o...]

: : Sent: February 27, 2002 7:26 AM

: : To: ASP Forms

: : Subject: [asp_forms] Re: Multiple Logins Problem

: :

: :

: : building on this...

: : if you use te database like david has mentioned (which i think is the

most

: : scaleable method) you will have a legitmante problem with users not

: logging

: : out and cleaning up. so to fix this problem, or somewhat fix it, when

you

: : havigate to the login page, after login is succeeded, popup a new

window.

: : now you have control of that window. then in that new window that you

: : opened, have a frameset, with only 2 frames, the top one will contain

your

: : pages, and the bottom one will only be 1px tall, then in the frameset

page

: : set the onunload event to call a function from the parent window

: : (window.opener.functionname) the function in the parent window will

clean

: up

: : the user info, now you also should have a button that will call this

same

: : function. but this will cause problems if they log out and then it will

: try

: : to log out automatically. so then set a variable on the parent window

page

: : to = 1 if they logged out, or leave it to 0 if not, then in the function

: you

: : can test and only have the onunload event call the function if the value

: is

: : = 0.

: :

: : this is all just coming from my brain.. and i havnt tested.. but try it

: out.

: : the onunload event may or may not work.. but let us know!

: :

: : daniel

: :

: : --

: : -----------------------------

: : Daniel O'Dorisio

: : daniel@o...

: : www.odorisio-networks.com

: : -----------------------------

: : "David Slater" <proc_dev@h...> wrote in message

: : news:151043@a..._forms...

: : :

: : : You need a database authentication system.

: : : You need to store the user name in a db with a column that gets set to

1

: : say

: : : when they are logged in.

: : : When a user tries to login you look for this column to see if it set

to

: 1

: : or

: : : not.

: : : The problem comes when they don't log out properly. So I guess its

some

: : : combination of session variables and a db to store the details.

: : :

: : :

: : : >From: akif noor <akifnoor@y...>

: : : >Reply-To: "ASP Forms" <asp_forms@p...>

: : : >To: "ASP Forms" <asp_forms@p...>

: : : >Subject: [asp_forms] Re: Multiple Logins Problem

: : : >Date: Wed, 27 Feb 2002 03:18:47 -0800 (PST)

: : : >

: : : >I have tried the solution of session variables.

: : : >but if u can explain in detail it will be easy for me

: : : >

: : : >Bye

: : : >akif noor

: : : >

: : : >--- Bharat Saboo <bharatsaboo@h...> wrote:

: : : > > try using session variables

: : : > >

: : : > > bharat

: : : > >

: : : > >

: : : > > >From: akifnoor@y...

: : : > > >Reply-To: "ASP Forms" <asp_forms@p...>

: : : > > >To: "ASP Forms" <asp_forms@p...>

: : : > > >Subject: [asp_forms] Multiple Logins Problem

: : : > > >Date: Wed, 27 Feb 2002 10:48:55

: : : > > >

: : : > > >I have developed a site and from our client we have

: : : > > a requirement that

: : : > > >at any time only one user can be log in to the

: : : > > server with the same

: : : > > >user name.

: : : > > >

: : : > > >it means

: : : > > >

: : : > > >same user can't log in from different machines.

: : : > > >

: : : > > >if one user is log in from one machine it can't be

: : : > > >log in from any other machine till first user is

: : : > > logged off.

: : : > > >

: : : > > >if any body have some idea plz share with me .

: : : > > >thanks

: : : > > >akif noor





: : : > > $subst('Email.Unsub').

: : : > >

: : : > >

: : : > >

: : : >_________________________________________________________________

: : : > > Send and receive Hotmail on your mobile device:

: : : > > http://mobile.msn.com

: : : > >

: : : > >





: : : >$subst('Email.Unsub').

: : : >

: : : >

: : : >=====

: : : >

: : : >

: : : >__________________________________________________

: : : >Do You Yahoo!?

: : : >Yahoo! Greetings - Send FREE e-cards for every occasion!

: : : >http://greetings.yahoo.com

: : : >




: : $subst('Email.Unsub').

: : :

: : :

: : : _________________________________________________________________

: : : Chat with friends online, try MSN Messenger: http://messenger.msn.com

: : :

: : :

: : :

: :

: :

: :




$subst('Email.Unsub').

: :

: :

: :

:

:

:




:

:

















Message #15 by Greg Griffiths <greg.griffiths@g...> on Thu, 28 Feb 2002 12:04:18 +0000
You could hold a table that lists the current logged in users, but this 

means you will have to get them to 'log out' when they have finished to 

delete their entry from the table. You could alternative hold this at the 

ASP application level as an array.



At 10:48 27/02/02 +0000, you wrote:

>I have developed a site and from our client we have a requirement that

>at any time only one user can be log in to the server with the same

>user name.

>

>it means

>

>same user can't log in from different machines.

>

>if one user is log in from one machine it can't be

>log in from any other machine till first user is logged off.

>

>if any body have some idea plz share with me .

>thanks

>akif noor







  Return to Index