Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Extends "logged_in" cookie to 5000 years (#485)
Vignesh Joglekare98558fc2db3
diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.exindex 0361315c62..915e46b0d5 100644--- a/lib/plausible_web/controllers/auth_controller.ex+++ b/lib/plausible_web/controllers/auth_controller.ex@@ -37,7 +37,7 @@ defmodule PlausibleWeb.AuthController doconn|> put_session(:current_user_id, user.id)- |> put_resp_cookie("logged_in", "true", http_only: false)+ |> put_resp_cookie("logged_in", "true", [http_only: false, max_age: 60 * 60 * 24 * 365 * 5000])|> redirect(to: "/activate"){:error, changeset} ->@@ -220,7 +220,7 @@ defmodule PlausibleWeb.AuthController doconn|> put_session(:current_user_id, user.id)- |> put_resp_cookie("logged_in", "true", http_only: false)+ |> put_resp_cookie("logged_in", "true", [http_only: false, max_age: 60 * 60 * 24 * 365 * 5000])|> put_session(:login_dest, nil)|> redirect(to: login_dest)elsediff --git a/lib/plausible_web/plugs/require_logged_out.ex b/lib/plausible_web/plugs/require_logged_out.exindex d25ee1b532..ee6c174541 100644--- a/lib/plausible_web/plugs/require_logged_out.ex+++ b/lib/plausible_web/plugs/require_logged_out.ex@@ -9,7 +9,7 @@ defmodule PlausibleWeb.RequireLoggedOutPlug docond doconn.assigns[:current_user] ->conn- |> put_resp_cookie("logged_in", "true", http_only: false)+ |> put_resp_cookie("logged_in", "true", [http_only: false, max_age: 60 * 60 * 24 * 365 * 5000])|> Phoenix.Controller.redirect(to: "/sites")|> halt