Jump to content

Getting Individual Hosts Under The Same Ip?


MrFish

Recommended Posts

I'm trying to track login based on IP addresses but not sure if it's possible. I've always used sessions but I want to be able to use IPs for a specific reason. People also should be able to log into the same website on the same network but not on two accounts on the same computer. No one should be able to login to the same user on different computers.Pretty standard I think. But I'm not much of a network person so I never noticed that all the computers connected to the same router have the same IP.I also assumed it was ###.###.###.XXXwhere the X's was the name of your specific machine within your network. But now I got to go back to the bare bones of my site and fix this problem. I still would like to use IP so is there any way I could get the specific host within a network or is the forward facing address of the router the only thing I'm allowed to read? Also. This raises a question for me with Sessions. I thought a session was called based on your IP. And yet I've logged into a session site on one computer and I wasn't logged into the site one a different computer on the same network. I'm confused.

Link to comment
Share on other sites

<div>

I still would like to use IP so is there any way I could get the specific host within a network or is the forward facing address of the router the only thing I'm allowed to read?
</div><div>i belive there is a database of host by ip address as there is geoip.</div><div> </div><div>You can use override the session storage where session will be stored in database. in that database you can specify a column for IP and make it unique constraint. so that every time new session is assighned by same ip it will thorw some error catc te error code to detect it. check this for custom session handling http://php.net/function.custom_session_handler.</div>
Link to comment
Share on other sites

How does a session know which host to point to if all the session information is contained on the server and the ip doesn't look different between hosts on the same network? It's not like it has a steady socket connection.

Link to comment
Share on other sites

It uses cookies. And if cookies are disabled, the session appends the session ID to the URLs of the site. Cookies are the only real way to identify a machine. But they're easy to fake and they can be deleted or not accepted.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...