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
Limit 1 login per computer...
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
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
Mac
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...
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...
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK