mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-17 11:21:39 -10:00
on the server and store session data and ids. * StateServerItem.cs: Container for session data. * SessionStateServerHandler.cs: Handler that communicates with the StateServer so sessions can be stored out of process. * SessionStateModule.cs: Allow state server mode. svn path=/trunk/mcs/; revision=20411
56 lines
896 B
C#
56 lines
896 B
C#
//
|
|
// System.Web.SessionState.RemoteStateServer
|
|
//
|
|
// Author(s):
|
|
// Jackson Harper ([email protected])
|
|
//
|
|
// (C) 2003 Novell, Inc (http://www.novell.com)
|
|
//
|
|
|
|
|
|
using System;
|
|
using System.Collections;
|
|
|
|
namespace System.Web.SessionState {
|
|
|
|
internal class RemoteStateServer : MarshalByRefObject {
|
|
|
|
private Hashtable table;
|
|
|
|
internal RemoteStateServer ()
|
|
{
|
|
table = new Hashtable ();
|
|
}
|
|
|
|
internal void Insert (string id, StateServerItem item)
|
|
{
|
|
table.Add (id, item);
|
|
}
|
|
|
|
internal void Update (string id, byte [] data)
|
|
{
|
|
StateServerItem item = table [id] as StateServerItem;
|
|
|
|
if (item == null)
|
|
return;
|
|
|
|
item.Data = data;
|
|
item.Touch ();
|
|
}
|
|
|
|
internal StateServerItem Get (string id)
|
|
{
|
|
StateServerItem item = table [id] as StateServerItem;
|
|
|
|
if (item == null || item.IsAbandoned ())
|
|
return null;
|
|
|
|
item.Touch ();
|
|
return item;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|