소스 검색

2005-12-22 Gonzalo Paniagua Javier <[email protected]>

	* FormsAuthenticationModule.cs: expire the cookie. Fixes bug #77043.
	Patch by Cyrille Colin.


svn path=/trunk/mcs/; revision=54717
Gonzalo Paniagua Javier 20 년 전
부모
커밋
203dbe820f
2개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      mcs/class/System.Web/System.Web.Security/ChangeLog
  2. 4 0
      mcs/class/System.Web/System.Web.Security/FormsAuthenticationModule.cs

+ 5 - 0
mcs/class/System.Web/System.Web.Security/ChangeLog

@@ -1,3 +1,8 @@
+2005-12-22 Gonzalo Paniagua Javier <[email protected]>
+
+	* FormsAuthenticationModule.cs: expire the cookie. Fixes bug #77043.
+	Patch by Cyrille Colin.
+
 2005-12-13 Gonzalo Paniagua Javier <[email protected]>
 
 	* FormsAuthenticationModule.cs: ignore any exception thrown when mapping

+ 4 - 0
mcs/class/System.Web/System.Web.Security/FormsAuthenticationModule.cs

@@ -114,11 +114,15 @@ namespace System.Web.Security
 			if (ticket == null || (ticket.IsPersistent && ticket.Expired))
 				return;
 
+			FormsAuthenticationTicket oldticket = ticket;
 			if (slidingExpiration)
 				ticket = FormsAuthentication.RenewTicketIfOld (ticket);
 
 			context.User = new GenericPrincipal (new FormsIdentity (ticket), new string [0]);
 
+			if (cookie.Expires == DateTime.MinValue && oldticket == ticket) 
+				return;
+
 			cookie.Value = FormsAuthentication.Encrypt (ticket);
 			cookie.Path = cookiePath;
 			if (ticket.IsPersistent)