Change Session plugin to keep track of the current session
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");
}
public override void Deinit(WebThing wt) {
if (Options.ContainsKey("AutoSave") && Config.ParseBool(Options["AutoSave"])) {
- SaveSession("Default");
+ SaveSession(CurrentSession);
}
}