luci-base: expunge correct transport cookies on logout
authorPaul Donald <newtwen+github@gmail.com>
Fri, 20 Sep 2024 15:39:58 +0000 (17:39 +0200)
committerPaul Donald <newtwen+github@gmail.com>
Fri, 20 Sep 2024 15:39:58 +0000 (17:39 +0200)
Closes #7269

Thanks to @mikma

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
modules/luci-base/ucode/controller/admin/index.uc

index f0f7c7fd4dab010bc2c6b3edba7a2b035fe92d0d..d433e1161ea1069a72d7ace916915e82df3ce4b8 100644 (file)
@@ -143,8 +143,8 @@ return {
 
                        if (http.getenv('HTTPS') == 'on')
                                http.header('Set-Cookie', `sysauth_https=; expires=Thu, 01 Jan 1970 01:00:00 GMT; path=${url}`);
-
-                       http.header('Set-Cookie', `sysauth_http=; expires=Thu, 01 Jan 1970 01:00:00 GMT; path=${url}`);
+                       else
+                               http.header('Set-Cookie', `sysauth_http=; expires=Thu, 01 Jan 1970 01:00:00 GMT; path=${url}`);
                }
 
                http.redirect(url);