客户端机器唯一ID

发布于 2024-12-20 22:45:47 字数 452 浏览 2 评论 0原文

是否有任何脚本方法可以生成客户端计算机的固定唯一 ID? 我的情况是:

当浏览器从网络服务器请求视频时,我需要存储一个唯一的ID来识别客户端。使用 UUID 等唯一 ID 不起作用,因为当客户端打开新选项卡并观看同一视频时,它会生成另一个 ID,但实际上是同一个客户端。

它必须是通用的,才能与大多数操作系统兼容。使用WMI可以获取客户端MAC地址,但仅适用于Windows平台。据我们所知,JavaScript 和服务器端脚本(如 JSP)(我现在正在使用)无法获取大多数操作系统级别的信息,例如 MAC 地址和内部 IP 地址。

我还试图避免使用 Java Applet 和另一个外部程序,我可以获取客户端的内部 IP 地址,因为如果禁用 JRE,它将无法工作。

我更喜欢使用 javascript、JSP 或 Servlet。不过,任何其他想法也将受到赞赏 ^^

有什么想法吗?

谢谢^^

Is there any scripting method to generate a fixed unique ID of client machine?
My situation is:

When the browser request the video from web server, I need to store a unique ID when to identify the client. Using Unique ID such as UUID won't work as when the client open a new tab and watch the same video, it will generate another ID but the reality is it is the same client.

It must be generic that it will be compatible with most OS. Using WMI can grab the client MAC address but it only works on Windows platform. As we know javascript and Server Side scripting like JSP (which i'm using now) could not get most of OS level information such as MAC address and Internal IP address.

I also trying to avoid from using Java Applet and another external program which I can grab client's internal IP address as it won't work if JRE is disabled.

I prefer using javascripts,JSP or Servlet. However any other idea will also be appreciated ^^

Any Idea guys?

Thanks^^

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

故人的歌 2024-12-27 22:45:47

生成 UUID 并将其存储为 cookie 怎么样?通过这种方式,您可以在重新访问时唯一地标识一台计算机,直到用户清除其缓存或隐身浏览

How about generating an UUID and storing it as a cookie ? This way you can uniquely identify a machine on revisits until the user clears his cache or browses incognito

傾旎 2024-12-27 22:45:47

似乎您想创建和存储会话数据。我会更深入地研究设置/获取 cookie 数据,看看是否无法设置 cookie 来解决这个问题。

如果这是为了保护/防止用户观看两个视频,我会小心地实施客户端解决方案。

您还可以考虑其他因素,包括用户代理、IP 地址、cookie 等。

Seems like you want to create and store session data. I would take a deeper look into setting/getting cookie data, and see if you cannot set a cookie to solve this issue.

If this is to secure/prevent users from watching two videos, I would be careful implementing a client-side solution.

You may also be able to take other things into consideration, including user-agent, IP address, cookies, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文