//
// 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-2006 Novell, Inc (http://www.novell.com)
-// (C) 2003 Stefan Görling (http://www.gorling.se)
+// (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
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-
+#if !NET_2_0
using System.Web.Configuration;
using System.Web.Caching;
using System.Web.Util;
static object locker = new object ();
#if TARGET_J2EE
- static private SessionConfig config {
+static private SessionConfig config {
get {
return (SessionConfig)AppDomain.CurrentDomain.GetData("SessionStateModule.config");
}
AppDomain.CurrentDomain.SetData("SessionStateModule.handlerType", value);
}
}
-#else
-#if NET_2_0
- static SessionStateSection config;
#else
static SessionConfig config;
-#endif
static Type handlerType;
#endif
ISessionHandler handler;
handler.Dispose();
}
-#if NET_2_0
- SessionStateSection GetConfig ()
-#else
SessionConfig GetConfig ()
-#endif
{
lock (locker) {
if (config != null)
return config;
-#if NET_2_0
- config = (SessionStateSection) WebConfigurationManager.GetSection ("system.web/sessionState");
-#else
config = (SessionConfig) HttpContext.GetAppConfig ("system.web/sessionState");
if (config == null)
config = new SessionConfig (null);
-#endif
#if TARGET_J2EE
if (config.Mode == SessionStateMode.SQLServer || config.Mode == SessionStateMode.StateServer)
public void Init (HttpApplication app)
{
sessionForStaticFiles = (Environment.GetEnvironmentVariable ("MONO_XSP_STATIC_SESSION") != null);
-#if NET_2_0
- SessionStateSection cfg = GetConfig ();
-#else
SessionConfig cfg = GetConfig ();
-#endif
if (handlerType == null)
return;
internal void OnSessionRemoved (string key, object value, CacheItemRemovedReason reason)
{
-#if NET_2_0
- SessionStateSection cfg = GetConfig ();
-#else
SessionConfig cfg = GetConfig ();
-#endif
// Only invoked for InProc (see msdn2 docs on SessionStateModule.End)
if (cfg.Mode == SessionStateMode.InProc)
}
}
+#endif