From 44b27dc61f4f25e3e053d8f27957d43d4aaece53 Mon Sep 17 00:00:00 2001 From: lorol Date: Sat, 9 May 2020 20:05:23 -0400 Subject: [PATCH] Logoff Cookie Authentication in the example --- examples/SmartSwitch/SmartSwitch.ino | 7 ++++--- examples/SmartSwitch/data/index.htm | 1 + examples/SmartSwitch/data/login/index.htm | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/SmartSwitch/SmartSwitch.ino b/examples/SmartSwitch/SmartSwitch.ino index 9609e9d..2c31bf7 100644 --- a/examples/SmartSwitch/SmartSwitch.ino +++ b/examples/SmartSwitch/SmartSwitch.ino @@ -23,9 +23,10 @@ Use latest ESP core lib (from Github) //See https://github.com/me-no-dev/ESPAsyncWebServer/pull/684 #define USE_AUTH_COOKIE -#define MY_COOKIE_FULL "LLKQ=7;max-age=31536000;" -#define MY_COOKIE_DEL "LLKQ=" -#define MY_COOKIE "LLKQ=7" +// 1 year age, path helps Safari to unset +#define MY_COOKIE_FULL "LLKQ=3; Max-Age=31536000; Path=/;" +#define MY_COOKIE_DEL "LLKQ=; Max-Age=-1; Path=/;" +#define MY_COOKIE "LLKQ=3" #ifndef USE_AUTH_COOKIE #define USE_AUTH_STAT //Base Auth for stat, /commands and SPIFFSEditor diff --git a/examples/SmartSwitch/data/index.htm b/examples/SmartSwitch/data/index.htm index 9f7da5b..68aaefa 100644 --- a/examples/SmartSwitch/data/index.htm +++ b/examples/SmartSwitch/data/index.htm @@ -329,6 +329,7 @@
+

Logoff

diff --git a/examples/SmartSwitch/data/login/index.htm b/examples/SmartSwitch/data/login/index.htm index c522ea4..5e39f6f 100644 --- a/examples/SmartSwitch/data/login/index.htm +++ b/examples/SmartSwitch/data/login/index.htm @@ -12,7 +12,7 @@

Password

- +