Javascript重定向头或会话ID [英] Javascript redirect with headers or session id

查看:73
本文介绍了Javascript重定向头或会话ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个网页,我正试图发送信息。一个是登录页面,它接收用户信息并调用Web服务来确定用户是否已通过身份验证。在确认身份验证后,我想通过某种方式告诉用户已经登录并进行了身份验证,然后重定向到我的其他网页。



我知道javascript有 window.location = url 但据我所知,这不会转发认证头或其他任何东西。有没有办法重定向与身份验证头或其他方式来告诉用户通过身份验证?



感谢您的任何帮助。

解决方案

由于javascript是客户端语言,因此没有标准方法,但您有一些可选的低安全性解决方案。不需要使用客户端语言也为了更好的安全性,你最好坚持使用PHP或其他服务器端语言。因为JavaScript可以很容易地跳过,它可能会让你陷入困境。



只要使用你的验证语言的会话和头函数也。

希望这有帮助,
问候。


I have two web pages that I am trying to send information between. One is the login page that takes in the users information and calls a web-service to determine if the user is authenticated. Upon ensuring authentication I want to redirect to my other web page with some way of telling that the user has logged in and is authenticated.

I know that javascript has window.location = url but this does not forward the authentication header or anything else as far as I know. Is there a way to redirect with authentication headers or other way to tell the user is authenticated?

Thanks for any help.

解决方案

There is not a standard method for doing that since javascript is a client side language but you have some alternative low-security solutions.Sessions are not necessary to function a client side language also for the better security you better stick to PHP or some other server side language.Because javascript can be easily skipped and it might put you in a trouble.

Just use your authenticated language for session and header functions also.

Hope this helped, Regards.

这篇关于Javascript重定向头或会话ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆