//
// Authors:
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
-// Stefan Görling (stefan@gorling.se)
+// Stefan Görling (stefan@gorling.se)
// Jackson Harper (jackson@ximian.com)
//
-// Copyright (C) 2002,2003,2004,2005 Novell, Inc (http://www.novell.com)
-// (C) 2003 Stefan Görling (http://www.gorling.se)
+// Copyright (C) 2002-2006 Novell, Inc (http://www.novell.com)
+// (C) 2003 Stefan Görling (http://www.gorling.se)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class SessionStateModule : IHttpModule
{
- internal static readonly string CookieName = "ASPSESSION";
- internal static readonly string HeaderName = "AspFilterSessionId";
+ internal const string CookieName = "ASPSESSION";
+ internal const string HeaderName = "AspFilterSessionId";
static object locker = new object ();
#if TARGET_J2EE
+#if NET_2_0
+ static private SessionStateSection config {
+ get
+ {
+ return (SessionStateSection) AppDomain.CurrentDomain.GetData ("SessionStateModule.config");
+ }
+ set
+ {
+ AppDomain.CurrentDomain.SetData ("SessionStateModule.config", value);
+ }
+ }
+ static private Type handlerType
+ {
+ get
+ {
+ return (Type) AppDomain.CurrentDomain.GetData ("SessionStateModule.handlerType");
+ }
+ set
+ {
+ AppDomain.CurrentDomain.SetData ("SessionStateModule.handlerType", value);
+ }
+ }
+#else
static private SessionConfig config {
get {
return (SessionConfig)AppDomain.CurrentDomain.GetData("SessionStateModule.config");
AppDomain.CurrentDomain.SetData("SessionStateModule.handlerType", value);
}
}
+#endif
#else
-#if CONFIGURATION_2_0
+#if NET_2_0
static SessionStateSection config;
#else
static SessionConfig config;
handler.Dispose();
}
-#if CONFIGURATION_2_0
+#if NET_2_0
SessionStateSection GetConfig ()
#else
SessionConfig GetConfig ()
if (config != null)
return config;
-#if CONFIGURATION_2_0
+#if NET_2_0
config = (SessionStateSection) WebConfigurationManager.GetSection ("system.web/sessionState");
#else
config = (SessionConfig) HttpContext.GetAppConfig ("system.web/sessionState");
public void Init (HttpApplication app)
{
sessionForStaticFiles = (Environment.GetEnvironmentVariable ("MONO_XSP_STATIC_SESSION") != null);
-#if CONFIGURATION_2_0
+#if NET_2_0
SessionStateSection cfg = GetConfig ();
#else
SessionConfig cfg = GetConfig ();
internal void OnSessionRemoved (string key, object value, CacheItemRemovedReason reason)
{
-#if CONFIGURATION_2_0
+#if NET_2_0
SessionStateSection cfg = GetConfig ();
#else
SessionConfig cfg = GetConfig ();