????? ???? ??? ????? ??????? ?????? ???? ????? ?? ASP.NET

?????? ????????? ?????? ?????????
???? ???????: 899918 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

????? ???

???? ??? ??????? ????? ?????? ??? ??????? ?????? ???? Microsoft ASP.NET.

??????? ????

???? ???? ????? ASP.NET ?? ????? ?????? ?? ????? ???????? ?? ???? ??????, ?????? ?????????. ???? ??????? ??????? ??? ??? ???????? ?????? ??????? ?? ???????? ???? ?? ????? ???? ???? ?????. ??? ????? ?????? ???? ???? ??? ?????? ????? ???? ???. ??? ????? ????? ???? ????? ???????? ??? ???????? ???????:
  • ????? ???? ????? ?? ??? ?? ??? ????? ???????? ???? ??? ??????? ??? ?????? ????????.
  • ?? ????? ????? ???? ????? ?? URL. ????? ??? ??????? ????? ??? ??? ????? ?????? ???? ?????.
?????? ???? ??? ?? ??? ?????? 120 ?? ??? ????? ????? ???? 20. ??? ????? ??????? ???? ???? ??????? ?? ???? ???? ????????? ??? ???? ????? URL. ??? ???? ??????? ?? ??? ??????? ??????? ?? ????? ??? ??? ??? ????? ????????. ??????? ?????? ????????? ?? ????? ???? ?????? ???????? ????? ????? ???????? ?????? ?????? ???? ?????.

??? ?????? ????? ??? ?????? ??? ?? ???????? ??? ???? ??? ???? ???? ?????? ???? ???? ????? ASP.NET ??? ????? ??? ????? ?????? ??? ?????? "ASP.NET_SessionId" ????? "?" ???? 20 ???.

??? ?????? ???????? ???? ??? ?????? DNS ? ????? ?????? ??? ?????? ??? cookie ??? ??? ?????? ???? ?? sourced ????.

??? ???? ??????? app1.tailspintoys.com app2.tailspintoys.com ??? ??????? ASP.NET. ??? ??? ???????? ????? ??? app1.tailspintoys.com ?? ????? ??? app2.tailspintoys.com ? ??? ????????? ??????? ??? ??? ????? ???????? "?" ????? ???? ????? ????? ???? ???? ???? ????? ?? ???????? ??? ?? ?????. ??? ?????? ????????? ???? ???? ????? ?????. ?????? ????????? ??? ????? ???? ?????.

????? ????? ????? ??????? ???? ??? ?????? ?????? ??????. ??? ???? ??????? ??? ??? ????? ????? ??????? ???? ??? ?????? ?? ??? ???? ?????? ??? ???:
  • ????? ????? ???? ??? ???? ??????? ????? ????? ??? ????? ?? ???? ???? ??? ????.
  • ????? ????? ???? ??? ????? ??? ????? ASP.NET ?? ???? ????.
??? ????? ??? ????? ????? ???? ???? ????? ?????? ???? ???? ?? ???? ?????? ????? ???? ???? ????? ??? ???? ???????? ?????? ?????? ???? ???. ???? ???? ???? ????? ??????? ??????? Session.Abandon. ???? ?? ????? Session.Abandon ??? ???? ???? ????? ??? ?????? ???? ???? ???? ?????. ???? ??? ???? ??????? ?????? ?????? ???????? 20 ?????. ?????? ?????? ??? ?? ????? ?? ??? ?? ???????? ?????? ??? ??? ???? ??? ???? ??? ????? ?????? ????? ???? ?????. ????? ????? ?????? ?? ????? ?????? ???? ???? ????? ???? ???? ??? ????? ???? ???? ?????. ??? ??????? ???? ????? ?? ?? ????? ??? ??????. ????? ???? ???????? ??????? ?????? ???? ????? ???? ?????? ??? ??????? ??????? ?????? ??. ????? ????? ?????? ?????? ??? ????? ???? ?????.

??? ??????? ??? ???? ???? ????? ?? ??????? ??? ????? ?????? ???? ???? ????? ??? ?? HttpCache. ???? HttpCache ????? ?? ????? ??? ?????? ???????:
  • ????? ????? ????? ??????? ????.
  • ????? ???? ???? ????? ????? ??? Session_OnEnd ???? ??????? ??? ????? ????? ????? ??????? ??????.
??? ????? "????? ????? ????? ????" ???? ???? ???? ??? ????? ?? ????? ??????? ??????, ??? ????? HttpCache ??????? ?? ?????? ??????????? ???????. ?? ??? ?????? ??? ????? ??????? Session_OnEnd.

??? ?????? ?? ???? ??? ? ?? ??? ????? ??? ????? ?????? ????? ???? ????? ?? ?????? ????????. ????? ????? ??? ?? ????? ???? ?????, ?? ????? ????? ??? ????? ??? ???? ??????? ??? ????? ???? ??? ??? ?? ???? ???? ???? ??? ????. ?? ??? ?????? ??? ??? ???????? ????? ??? ???? DNS ??? ??????? ???????? ?? ???? ???? ???? ????? ?????? ??? ??? ??????? ????? ?????? ?? ?? ????? ????.

?? ??? ???????? ?? ?? ????? ??? ????? ??????? ???? ???? ?????. ??? ??? ?? ???????? ??? ??? ???????? ??? ????? ??????? ???? ???? ????? ?????? ????????? ???????? ?????? ?????? ?? ???? ??? ?? ?? ?????? ????? ??? ????? ?????? ????? ???? ?????:
Session.Abandon();
Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));
??? ?????? ??? ???? ???? ???? ????? ?? ?????? ????? ?????? ??? ????? ?????? ???? ???? ????? ??? ???? ?????. ???? ????? ??? ????? ????? ???????? ?? ???????? ???? ????.

????? ?? ????? ?????? ?????? ?? ??????? ???? ???? ?????? ?? ??????? ?? ???? ??????? ??? ????? ?????? ??? ???? ???? ????? ??? ?? ??? ????? ????????. ???? ??? ?????? ??? ?????? ??? ???? ????? ?????? "?" ??? ????? ?????? ???? ???? ????? ???????? ????? ????????. ????? ?? ??? ??????? ????? ???? ??? ????? ??? ??? ???? ????? ?????? (login.aspx) ?????? ??? ????? ?????? ???? ??? ??????. ?????? ????? ?? ?????? ??? ????? ?????? ??? ?????? ?????????. ?? ?? ?????? ?????? ????????? ??? ??????. ????? ???? ????? ??? ??? ????? ??? ????? ?????? ???? ?????? ??????? ??????? Response.Redirect. ???? ?????? ????? ????? ???????? ????? ?? ???? ?????? ASP.NET_SessionId ????? ?????? ??? ?? ???? ???? ??? cookie ??? ???? ????? ?????? ???? Response.Redirect. ????? ????? ????? ??????? ??? ????? ??????? ??? ???? ????? ??????.

?? ??? ?? ???? ?? ?????? ?????? ?? ????????? ???????? ? ????? ??????? ??? ????? ?????? ?????? ??? ????? ?? ??? ??? ???? ?????? ?????? ??? ???? ????? ??????. ???????? ?? ????? ???? ?? ???? ?? ?? ?? ??? ????? ??? ???? ????? ?????? ???????? ??? ????? ?????? ???? ?? ??? ????? ???????? ASP.NET ?????? ?????? ?????? ?? ????????? ???????? ??? FormsAuthentication ?????? ??? ????? ???????? ??? ????? ????????. ?? ???? ?????? ??? ???? ??????? 5. ???
private void Page_Load(object sender, System.EventArgs e)
{ 
if( !IsPostBack && 
( Request.Cookies["__LOGINCOOKIE__"] == null ||
Request.Cookies["__LOGINCOOKIE__"].Value == "" ) )
{
//At this point, we do not know if the session ID that we have is a new
//session ID or if the session ID was passed by the client. 
//Update the session ID.

Session.Abandon();
Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));

//To make sure that the client clears the session ID cookie, respond to the client to tell 
//it that we have responded. To do this, set another cookie.
AddRedirCookie();
Response.Redirect( Request.Path );
}

//Make sure that someone is not trying to spoof.
try
{
FormsAuthenticationTicket ticket =
FormsAuthentication.Decrypt( Request.Cookies["__LOGINCOOKIE__"].Value );

if( ticket == null || ticket.Expired == true ) 
throw new Exception();

RemoveRedirCookie();
}
catch
{
//If someone is trying to spoof, do it again.
AddRedirCookie();
Response.Redirect( Request.Path );
}


Response.Write("Session.SessionID="+Session.SessionID+"<br/>");
Response.Write("Cookie ASP.NET_SessionId="+Request.Cookies["ASP.NET_SessionId"].Value+"<br/>");
} 

private void RemoveRedirCookie() 
{ 
Response.Cookies.Add(new HttpCookie("__LOGINCOOKIE__", "")); 
} 

private void AddRedirCookie()
{

FormsAuthenticationTicket ticket = 
new FormsAuthenticationTicket(1,"Test",DateTime.Now,DateTime.Now.AddSeconds(5), false,""); 
string encryptedText = FormsAuthentication.Encrypt( ticket ); 
Response.Cookies.Add( new HttpCookie( "__LOGINCOOKIE__", encryptedText ) );
}

???????

???? ???????: 899918 - ????? ??? ??????: 15/?????/1427 - ??????: 1.3
????? ???
  • Microsoft .NET Framework 1.1
????? ??????: 
kbmt kbinfo kbhowto KB899918 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????899918

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com