+2003-11-13 Jackson Harper <jackson@ximian.com>
+
+ * SessionInProcHandler.cs: Use AppDomain.SetData so data is
+ available across all threads. Set the path of session id
+ cookies. Patch by Mohammad DAMT. Fixes bug #50922.
+
2003-11-06 Jackson Harper <jackson@ximian.com>
* ISessionHandler.cs: Pass the SessionStateModule to handlers when
* Generate SessionID:s in a good (more random) way.
*/
using System;
+using System.IO;
using System.Collections;
namespace System.Web.SessionState
public void Init (HttpApplication context, SessionConfig config)
{
- _sessionTable = new Hashtable();
+ _sessionTable = (Hashtable) AppDomain.CurrentDomain.GetData (".MonoSessionInProc");
+ if (_sessionTable == null)
+ _sessionTable = new Hashtable();
}
public void UpdateHandler (HttpContext context, SessionStateModule module)
false)); //readonly
// puts it in the table.
_sessionTable [sessionID]=container;
+ AppDomain.CurrentDomain.SetData (".MonoSessionInProc", _sessionTable);
// and returns it.
context.SetSession (container.SessionState);
// sets the session cookie. We're assuming that session scope is the default mode.
- context.Response.AppendCookie (new HttpCookie (COOKIE_NAME,sessionID));
+ HttpCookie cookie = new HttpCookie (COOKIE_NAME,sessionID);
+ cookie.Path = Path.GetDirectoryName (context.Request.Path);
+ context.Response.AppendCookie (cookie);
// And we're done!
return true;