Logoff Cookie Authentication in the example

This commit is contained in:
lorol
2020-05-09 20:05:23 -04:00
parent 2aa029bc40
commit 44b27dc61f
3 changed files with 6 additions and 4 deletions

View File

@@ -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

View File

@@ -329,6 +329,7 @@
<div id="g2" class="gauge"></div>
<div id="C" class="clk" onclick="getBtime();"></div>
<div id="C2" class="clk2"></div>
<p><a href="/login">Logoff</a></p>
</div>
<script src="app.min.js"></script>

View File

@@ -12,7 +12,7 @@
<br><br>
<h4>Password</h4>
<form action="/lg2n" method="post">
<input type="password" name="pa2w">
<input type="password" name="pa2w"><br><br>
<input type="checkbox" name="lg0f"><label for="lg0f">Logoff</label><br><br>
<input type="submit" value="Submit">
</form></center>