// (C) 2002,2003 Ximian, Inc (http://www.ximian.com)
//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
using System;
using System.Collections;
using System.IO;
static string cookiePath;
static int timeout;
static FormsProtectionEnum protection;
+#if NET_1_1
+ static bool requireSSL;
+ static bool slidingExpiration;
+#endif
// same names and order used in xsp
static string [] indexFiles = { "index.aspx",
(values [4] == "1"),
values [5],
values [6]);
- } catch (Exception e) {
+ } catch (Exception) {
ticket = null;
}
timeout = authConfig.Timeout;
cookiePath = authConfig.CookiePath;
protection = authConfig.Protection;
+#if NET_1_1
+ requireSSL = authConfig.RequireSSL;
+ slidingExpiration = authConfig.SlidingExpiration;
+#endif
} else {
cookieName = ".MONOAUTH";
timeout = 30;
cookiePath = "/";
protection = FormsProtectionEnum.All;
+#if NET_1_1
+ slidingExpiration = true;
+#endif
}
initialized = true;
return tOld;
FormsAuthenticationTicket tNew = tOld.Clone ();
- tNew.SetDates (now, now - toExpiration + toIssue);
+ tNew.SetDates (now, now + (tOld.Expiration - tOld.IssueDate));
return tNew;
}
return cookiePath;
}
}
+#if NET_1_1
+ public static bool RequireSSL {
+ get {
+ Initialize ();
+ return requireSSL;
+ }
+ }
+
+ public static bool SlidingExpiration {
+ get {
+ Initialize ();
+ return slidingExpiration;
+ }
+ }
+#endif
}
}