Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP Login: Only One User Logged In!
Old 08-02-2008, 04:06 AM PHP Login: Only One User Logged In!
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
So, I've grasped the basics of login, however I'm looking to make it so only one user can be logged in to an account at one time. How could I go about achieving this do you think?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
 
Register now for full access!
Old 08-02-2008, 09:22 AM Re: PHP Login: Only One User Logged In!
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
All you would need is to query a single BOOL inside of a database that is switched on and off on login/logout.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 08-02-2008, 09:35 AM Re: PHP Login: Only One User Logged In!
Galaxian's Avatar
Rich Powell

Posts: 842
Name: Rich Powell
Location: United Kingdom
Trades: 0
Hmm. It's cookie based right now. What about when the cookies expire?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Please help get the new
Please login or register to view this content. Registration is FREE
forum started for Webmasters like you!

Galaxian is offline
Reply With Quote
View Public Profile Visit Galaxian's homepage!
 
Old 08-02-2008, 02:31 PM Re: PHP Login: Only One User Logged In!
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
The cookie is client side. You have to record someplace on your server that someone with that cookie is currently on.
And that brings another problem. When is someone logged out ?
Is it when they click a "logout" button/links, after x minutes of inactivity, both ???

This question is still there if you record on a database who is online/offline, but due to the nature of the web, if someone is logged on your site, and simply browse away to another site, what do you do ?
If you want to prevent his loggin from being used several places at the same time, he could maybe come back later to find himself locked out because he has not clicked on "log out".
Another problem I was confronted some years ago: IE can be setup to use new sessions on every ctrl+n.
In the case of a session based login, 2 windows of IE on the same computer would be seen like 2 different login, because of this setting.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to PHP Login: Only One User Logged In!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21557 seconds with 12 queries