Jump to content

Archived

This topic is now archived and is closed to further replies.

desithugg

umm problem...with login

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.?

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.