Page 1 of 1

Login Help

Posted: Tue May 29, 2007 3:42 pm
by Smackie
Can someone help me or point me to a tutorial that can help me?

Basicly i have a login script ok and i want to make it where users can't login with the same name while they already logged on with a session if that make since..

if not basicly if a user logs in and tries either getting on a different username or there name again it will tell them they can't login..

now is this possible?

Thank you
Smackie

Posted: Tue May 29, 2007 3:58 pm
by superdezign
Just... Make it so that if they're logged in, the login pages displays "You are already logged in" rather than a login form.

Or... have I read your question incorrectly?

Posted: Tue May 29, 2007 4:21 pm
by Smackie
you read my post wrong i want it so that users can't login double time..

Posted: Tue May 29, 2007 5:02 pm
by RobertGonzalez
No, SD got your question right then. If they are logged in, don't even give them the option of seeing the login form. And to protect yourself on the server-side, if the page loads and the user is logged, header() redirect them to another page so their is no chance that they will ever be able to see the login form or the processing page in an attempt to login twice.

Posted: Wed May 30, 2007 1:45 am
by Smackie
not really because i can login and then open another page up and login again with a different username i mean im using sessions and stuff but still for some reason i can login with more then 1 user name

Posted: Wed May 30, 2007 10:59 am
by RobertGonzalez
That is going to be nearly impossible to enforce unless you rely on IP address, which is unreliable at best.

PS I thought you meant log in with the same username. Why would you want to keep someone from logging in with two different identities at the same time?

Posted: Wed May 30, 2007 11:09 am
by Smackie
Well Im creating a game and i down want them playing 2 or more chars at the same time i dont care if they have 2 or more chars just as long as they play one at a time

Posted: Wed May 30, 2007 11:14 am
by superdezign
So, you mean someone like, logging in on Firefox, then logging in again on Internet Explorer or Opera? (I always put FF first :-p)

The best that you could do is create a cookie (are they cross-browser?), or program your game somewhere other than a web browser.

Posted: Wed May 30, 2007 11:35 am
by RobertGonzalez
Cookies are not cross browser.

Posted: Wed May 30, 2007 11:40 am
by superdezign
Everah wrote:Cookies are not cross browser.
Yeah, web development is very dependent of browsers, We are at the mercy of Mozilla, Opera, and Microsoft when we program and if they don't support something, there's not much that we can do about it other than attempt to fake it.

You don't see many complex in-browser games unless they are programmed through some other medium such as Flash, Java, or Shockwave.

Posted: Wed May 30, 2007 12:46 pm
by nyfael
If you don't mind them having several characters you should make all the characters belong to one account, and then only let the account be logged into from 1 computer a time.

Trying to stop someone from being on 2 at once without them belonging to the same account is going to be very hard otherwise.

-Kerry