From ac127998500aa775484054cffa889098b3fd6a7b Mon Sep 17 00:00:00 2001 From: Chip Black Date: Tue, 9 Jun 2009 01:35:45 -0500 Subject: [PATCH] Change Session plugin to keep track of the current session --- plugins/Session.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/Session.cs b/plugins/Session.cs index 37d848c..bec316f 100644 --- a/plugins/Session.cs +++ b/plugins/Session.cs @@ -5,12 +5,14 @@ using bytex64.WebThing; public class Session : WebThingPlugin { WebThing wt; + string CurrentSession = "Default"; public override void Init(WebThing wt) { this.wt = wt; if (Config.Arguments.Length == 0) { if (Config.Options.ContainsKey("Session")) { RestoreSession(Config.Options["Session"]); + CurrentSession = Config.Options["Session"]; } else if (Options.ContainsKey("Default")) { RestoreSession("Default"); } @@ -19,7 +21,7 @@ public class Session : WebThingPlugin { public override void Deinit(WebThing wt) { if (Options.ContainsKey("AutoSave") && Config.ParseBool(Options["AutoSave"])) { - SaveSession("Default"); + SaveSession(CurrentSession); } } -- 2.25.1