Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.
Moderator: General Moderators
Rockape
Forum Newbie
Posts: 1 Joined: Fri Sep 18, 2009 1:49 pm
Post
by Rockape » Fri Sep 18, 2009 1:52 pm
Hi all,
I'm trying to create a login script where the website will not allow the same user to login twice from different computers.
I have thoght of using sessions but have no clue how to go about it. Grateful for some advice.
thanks
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Fri Sep 18, 2009 3:41 pm
When a user logs in, generate a session ID for the user, and store it in the database along with their username.
Whenever a user tries to login, check if a session ID exists for the username they entered. If it does, deny them entry.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
hollywoods
Forum Newbie
Posts: 1 Joined: Tue Oct 27, 2009 12:59 pm
Post
by hollywoods » Tue Oct 27, 2009 1:28 pm
Thanks pickle, I will use it too.