Reputation: 16158
atm I am building my own auth system. But today I stumbled over a small problem.
How do I differentiate clients with the same ip ?
I first thought "hey no problem just look at their macip". But HTTP does not include the mac ip address and i can't run a python programm on the client.
So I would have to use some sort of javascript.
But this feels like a hack.
So I did some investigation Differentiating Between Two Computers On The Same Intranet
But how can I access the "clientport"? And is this a good solution ?
Upvotes: 1
Views: 280
Reputation: 773
From your question I deduce you're writing an authentication system based on HTTP, not just bare TCP. In this case, you could use cookies, which provides exactly the kind of tracking mechanism you need, and are the preferred choice for HTTP login mechanisms.
In generale, with HTTP you shouldn't have to worry and deal about IP addresses, you're a level higher in the stack.
Upvotes: 2
Reputation: 522567
Give the client a token on his first visit that he must send back to the server on each request to identify himself. In a web browser, that's a cookie with a session id or similar unique identifier. On non-web browser systems you can do something similar. There's no way to do this on a protocol level, since the underlying protocols (TCP/IP, HTTP) have been designed to route packets to their destination, unique identification is not part of that process.
Upvotes: 6