Page 1 of 1
Limit 1 login per computer...
Posted: Tue Dec 03, 2002 10:20 pm
by Kyori
How can I ensure that a user can access the site /w only 1 login at a time. Assuming he has 2 login.
IP add? how do I get IP add? sessions? how? thanks
Posted: Wed Dec 04, 2002 4:26 am
by twigletmac
You can get the IP for the client accessing your site from the $_SERVER array ($_SERVER['REMOTE_ADDR']). However, depending on the ISP the IP address may not stay constant throughout the session and the IP address may also be shared by a number of people going through a proxy. You could set a session variable when they log on that you can then use to see if they've already logged on before. There will be no foolproof method though.
Mac
Posted: Wed Dec 04, 2002 7:34 am
by Kyori
Just a thought... how about I use a cookie that tells user is already logged in. And cookie has expiration of 5 min or something like that. But everytime user does something (click anywhere on page) the cookie is refreshed.
IP adds seem nice but the fact that they do change a lot and some networks PCs share the same IP add isn't nice...
Posted: Wed Dec 04, 2002 7:45 am
by twigletmac
The cookie will work if the user a) has not disabled cookies and b) doesn't decide to edit the one that is set or delete it.
Mac