[System.Web] Fixes 50 year form authentication
authorgttds <ollie.yeoh@gmail.com>
Thu, 16 Jun 2016 15:46:21 +0000 (23:46 +0800)
committerGitHub <noreply@github.com>
Thu, 16 Jun 2016 15:46:21 +0000 (23:46 +0800)
commitb499a3e00b014f6333eb46e77269a00bdf260f8c
tree7f148cbeaf4f3be394727430842bcae7b7f80555
parentf8977a0f6ca99043445529e6bdce010432972058
[System.Web] Fixes 50 year form authentication

This fixes the bug where form authentication tickets do not expire until 50 years later.
I bumped into this bug after upgrading mono from 4.2.2 to 4.4.0

Firstly, the authentication ticket's expiry must always equal to the timeout attribute on the <forms/> element. It doesn't matter whether persistent or session cookies are used.

Secondly, if the cookie is persistent, then it's expiry should be set to the same as that of the authentication ticket.

Reference: https://blogs.msdn.microsoft.com/dansellers/2006/02/15/change-to-asp-net-2-0-forms-authentication-persistent-cookies/
mcs/class/System.Web/System.Web.Security/FormsAuthentication.cs