Any*_*are 5 asp.net security post portal
我post method
通过我的门户网站打开不同的网站,如下所示:
在我的门户主页面中:
<form method="post" target="_blank" action="">
<input id="Hdn_r" name="Hdn" type="hidden" value="55622">
.....
</form>
Run Code Online (Sandbox Code Playgroud)
然后在any site opened through the portal
我的主页面做以下检查:
var hr = HttpContext.Current.Request.UrlReferrer;
if (hr != null && !string.IsNullOrEmpty(hr.AbsolutePath))
{
if (Request.UrlReferrer.AbsolutePath.Contains("Portal"))
{
if (Request.Form["Hdn_r"] != null && !string.IsNullOrEmpty(Request.Form["Hdn_r"].ToString())
&& Request.Form["Hdn_a"] != null && !string.IsNullOrEmpty(Request.Form["Hdn_a"].ToString()) &&
Request.Form["Hdn_b"] != null && !string.IsNullOrEmpty(Request.Form["Hdn_b"].ToString()) &&
Request.Form["Hdn_c"] != null && !string.IsNullOrEmpty(Request.Form["Hdn_c"].ToString())
)
{
Session["emp_num"]= int.Parse(Request.Form["Hdn_r"].ToString());
//...........
Run Code Online (Sandbox Code Playgroud)
我的问题是:
如何通过我门户网站中的注销按钮单击从所有打开的网站注销?
假设我通过我的门户网站打开了三个网站,我希望当我退出(在门户网站中)从所有打开的应用程序中注销我?
注意:门户网站中的不同网站发布在不同的服务器上.
小智 2
为什么不尝试针对所有网站发出正确的 POST 请求,以便以编程方式注销?
请参阅http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(v=vs.110).aspx