standard_pages: cookie_path is not defined on register, password and profile #2237

Closed
opened 2026-10-27 11:34:53 +01:00 by adam · 0 comments
Owner

Since (#2557), setCookie() in themes/standard_pages/js/standard_pages.js reads a cookie_path, but only identification.tpl declares it. On register.php, password.php and profile.php the page throws Uncaught ReferenceError: cookie_path is not defined as soon as toggle_mode() runs, so the dark/light mode cookie is never set and the rest of the page init does not run.

On identification.tpl the variable is written without quotes (var cookie_path = {$COOKIE_PATH};), which is a JS syntax error when the gallery is at the root of the domain (var cookie_path = /;)

Since (#2557), setCookie() in `themes/standard_pages/js/standard_pages.js` reads a `cookie_path`, but only `identification.tpl` declares it. On `register.php`, `password.php` and `profile.php` the page throws `Uncaught ReferenceError: cookie_path is not defined` as soon as `toggle_mode()` runs, so the dark/light mode cookie is never set and the rest of the page init does not run. On `identification.tpl` the variable is written without quotes (`var cookie_path = {$COOKIE_PATH};`), which is a JS syntax error when the gallery is at the root of the domain (`var cookie_path = /;`) <!-- github-sync-id:5779861954 -->
adam closed this issue 2026-10-27 11:34:53 +01:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#2237