commit:ac127998500aa775484054cffa889098b3fd6a7b
author:Chip Black
committer:Chip Black
date:Tue Jun 9 01:35:45 2009 -0500
parents:a875e9685526f28076048f31ed4bb279ab46abc6
Change Session plugin to keep track of the current session
diff --git a/plugins/Session.cs b/plugins/Session.cs
line changes: +3/-1
index 37d848c..bec316f
--- 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);
         }
     }