LEarned ones please reply.

Status
Not open for further replies.

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
I am curious as to what the chances that 2 separate entities/computers/people have the same IP address ?

I have created a login system that uses cookies and logs the users IP and a few other details in the db. When creating a new cookie it clears the table of all entries that have the same IP. So if someone was to have the same IP then they would be logged out. Should I rather have it only clear the entries for that IP and the users id ?

As always, I am generous for little bits of info/feedback and will give credits where due !
 

Eric@TLG

New Member
Messages
113
Reaction score
0
Points
0
Well i think the first one entered should be kept. If by chance the second one comes along, well most instance its first come first serve. offer a seperate link to a well known proxy if this were to come up so they dont lose out on w/e it is. Or perhaps the matching IP is from the same person ??
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
That is what I want to eradicate. Any chance that the user has 2 login keys. So far I have tested on my local network at home. Each computer has different IP's and it works great. The cookie is encrypted with a custom script I wrote. The encryptions have 2 keys each and these are totally random at the time of issue.
The only thing I can think that would be a problem is if 2 users use the same computer that has a static IP (not that many people have them, I do as my SP only supports static IP's).
 
Last edited:

flinx

New Member
Messages
68
Reaction score
0
Points
0
At the same time? The only thing I can think of is when 2 ppl connect to the internet through the same router. Take the example of your home network. Inside of your LAN, each computer has a unique IP. But once you go onto the net, all of your computers will have the same external IP, which is the one assigned to you by your ISP (always the same if it's static, different from connection to connection if it isn't).

So if you don't want more than one login from the same IP at the same time, then you could do what you said in your first post. The only ones that might have problems are the ones connecting from different computers in the same LAN.
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
I have adjusted it to log the users id number along with the ip and the encryption keys. Then when they logout, it clears only rows that contain both the ip and the users id. When they log in, it again clears these rows. So never at one point will one user from one IP have 2 login tickets. If they login from another computer and the IP is the same in the case above (through a router) then bad luck for them, when they go back to the other computer the will have to re login. Can't think of a good way of getting around this.
 
Last edited:

mattura

Member
Messages
570
Reaction score
2
Points
18
Better safe than sorry, but most online games etc do not allow more than one user per IP, if you have a sibling who also uses, it can be a bind!
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
Closing this thread as I have overcome the issue, opening another soon for help.
 
Status
Not open for further replies.
Top