Jump to content

umm problem...with login


desithugg

Recommended Posts

umm i have a login system that compares username/password.Sessions/cookies
but recently ive been having a problem i use the login system for my rpg.Which contains of a battle system.But some users have decided to team up and train in one account at the same time.So they go way faster.Is there any way i can only have 1 person per account logged in at a time.I was thinking of making something like a session id.
I pick  randome (phrases) containing number,letters 29 characters long each.which is stored in the users table and the other is stored in the ips table.Than i receive the one from the ip using the persons ip and compare it to the one in the users table where the username mathches and if the Two rows match it lets the person continue and if not the person cant battle.Umm thats the best i could come up with/think of.Im not sure if it will work im assuming it will.
But any1 have any other ideas.?
Link to comment
Share on other sites

when someone logs in store their ip address in the table next to their username.

on each login check to see if the current ipaddress is the same as the one in the database if not boot em.

You will also have to store the last time they did sent a request - so each page will have to update that. If they have been inactive for say 20 mins then allow login for that username from anywhere once more.
Link to comment
Share on other sites

umm lemme make sure im understanding you.
So when a person logs in i store their ip next to their username and what time.Each page i can include an updatetime.php so the time iwll be updated.So if they have been inactive for more than 20 mins they get logged out.And than if they have been active in the last 20 mins i only let the stored ip address come in.Sorry if im confusing.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.