我知道如何使用javascript,但我需要一个安全的方法来做到这一点。 任何人都可以查看页面源,获取链接,不要等待5秒。
有什么解决方案吗? 我正在使用javascript和django。 谢谢!
I know how to do that with javascript but I need a secure way to do it. Anybody can view page source, get the link and do not wait 5 seconds.
Is there any solution? I'm working with javascript and django. Thanks!
最满意答案
唯一安全的方法是将逻辑放在检查时间的服务器上。 对服务器进行Ajax调用。 如果时间不到5秒,请不要返回HTML,如果大于,则返回要显示的html。
其他选项是让链接指向您的服务器,如果时间少于五秒,则将它们重定向到另一个页面。 如果大于5,则会将它们重定向到正确的内容。
无论哪种方式,它都要求您跟踪服务器上的会话时间并将其从客户端中删除。
The only secure way would be to put the logic on the server that checks the time. Make an Ajax call to the server. If the time is under 5 seconds, do not return the HTML, if it is greater than , than return the html to show.
Other option is to have the link point to your server and if the time is less than five seconds it redirects them to a different page. If it is greater than 5, it will redirect them to the correct content.
Either way, it requires you to keep track of session time on the server and remove it from the client.
更多推荐
发布评论