阻止用户查看页面超过 3 次

发布于 2024-12-20 14:50:02 字数 136 浏览 2 评论 0原文

有没有办法阻止查看者查看某个页面超过三遍?我目前正在使用通过 JQuery Cookie 插件创建的 cookie。到目前为止,它运行良好,但我知道用户可以简单地清除/删除 cookie 并再次访问该页面。有没有更好的替代方法来跟踪并防止用户多次查看?谢谢。

Is there anyway to prevent a viewer from viewing a certain page more than three times? I'm currently using cookies created with the JQuery Cookie plugin. So far it works well, but I know that the user can simply clear/erase cookies and access the page again. Is there any better alternatives to tracking and prevent users view more than once? Thanks.

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

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

发布评论

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

评论(3

最佳男配角 2024-12-27 14:50:02

您可以要求用户先进行身份验证,然后才能看到该页面。然后在服务器端,您可以跟踪给定的经过身份验证的用户请求该页面的次数。我怀疑任何其他机制都是不可规避的。

You could require that the user authenticate before they can see the page at all. Then on the server side you could track how many times the given authenticated user has requested the page. I doubt that any other mechanism would not be circumventable.

随风而去 2024-12-27 14:50:02

捕获用户 IP 地址并存储并使用计数器怎么样?

How about capturing users IP Address and storing them and use a counter?

旧情别恋 2024-12-27 14:50:02

您必须将其存储在服务器端,可能是通过数据库中的 IP 地址。

You would have to store it server side, probably by ip address in a database.

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