开发者

Is there another way to determine website user than by IP?

开发者 https://www.devze.com 2023-03-02 15:11 出处:网络
In my website i need to remember users that entered so next time thay enter i will show them content they were checking before.

In my website i need to remember users that entered so next time thay enter i will show them content they were checking before. Simplest way is IP check, but problem appears if there is a proxy. I dont want to run any java scripts on client side to get their ip. Is there any way to determine user? I know that also profiles - login would d开发者_开发技巧o, but i dont want to do so.

Thanks in advance, Marek.


You could set a persistent cookie, but that will just remain for that specific browser. (and they could clear their cookies)

The most reliable way is to have your users log in with a username and password - then you can keep details specific to them in a database and modify the site's behaviour like you mention next time they log in. However, this option doesn't work for anonymous visitors.


Consider setting a Cookie, which you can subsequently read and tailor content.


Cookies are what you want to use.


The standard way to remember users is setting a cookie. IP is totally ineffective, because many customery have dynamic IP addresses, let alone NAT. The way to set a cookie depends on the server language you are using.


Using a cookie could identify the user per browser per computer.


Marek, by default my recomendation would be to use cookies. Maybe record some ID in the cookie after the user loged in and use it to display custom content. Of course the user can always delete the cookie (or disable them all together), but it is a good solution for this kind of requirement.

0

精彩评论

暂无评论...
验证码 换一张
取 消