阻止用户查看页面超过 3 次
有没有办法阻止查看者查看某个页面超过三遍?我目前正在使用通过 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以要求用户先进行身份验证,然后才能看到该页面。然后在服务器端,您可以跟踪给定的经过身份验证的用户请求该页面的次数。我怀疑任何其他机制都是不可规避的。
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.
捕获用户 IP 地址并存储并使用计数器怎么样?
How about capturing users IP Address and storing them and use a counter?
您必须将其存储在服务器端,可能是通过数据库中的 IP 地址。
You would have to store it server side, probably by ip address in a database.