diff options
Diffstat (limited to 'mcs/class/System.Web/System.Web.Security')
3 files changed, 16 insertions, 2 deletions
diff --git a/mcs/class/System.Web/System.Web.Security/ChangeLog b/mcs/class/System.Web/System.Web.Security/ChangeLog index cf7612e3ae3..17865abd5bc 100644 --- a/mcs/class/System.Web/System.Web.Security/ChangeLog +++ b/mcs/class/System.Web/System.Web.Security/ChangeLog @@ -1,3 +1,12 @@ +2004-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * FormsAuthentication.cs: patch by Jim Pease to fix the date on renewal. + +2004-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * FormsAuthenticationModule.cs: don't renew expired cookies. Only renew + the cookie if SlidingExpiration is set. Thanks to Jim Pease. + 2004-06-12 Pedro Martínez Juliá <yoros@wanadoo.es> * FormsAuthentication.cs: Undo last change. diff --git a/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs b/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs index bee8998e76a..451cb0dc260 100644 --- a/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs +++ b/mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs @@ -311,7 +311,7 @@ namespace System.Web.Security return tOld; FormsAuthenticationTicket tNew = tOld.Clone (); - tNew.SetDates (now, now - toExpiration + toIssue); + tNew.SetDates (now, now + (tOld.Expiration - tOld.IssueDate)); return tNew; } diff --git a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationModule.cs b/mcs/class/System.Web/System.Web.Security/FormsAuthenticationModule.cs index f46923ad5b8..ac9f3c31327 100644 --- a/mcs/class/System.Web/System.Web.Security/FormsAuthenticationModule.cs +++ b/mcs/class/System.Web/System.Web.Security/FormsAuthenticationModule.cs @@ -82,7 +82,12 @@ namespace System.Web.Security return; FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt (cookie.Value); - ticket = FormsAuthentication.RenewTicketIfOld (ticket); + if (ticket == null || ticket.Expired) + return; + + if (config.SlidingExpiration) + ticket = FormsAuthentication.RenewTicketIfOld (ticket); + context.User = new GenericPrincipal (new FormsIdentity (ticket), new string [0]); cookie.Value = FormsAuthentication.Encrypt (ticket); |