Extends "logged_in" cookie to 5000 years (#485)

pull/452/head^2
Vignesh Joglekar 6 years ago committed by GitHub
parent 425975efec
commit e98558fc2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,7 +37,7 @@ defmodule PlausibleWeb.AuthController do
conn
|> 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 do
conn
|> 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)
else

@ -9,7 +9,7 @@ defmodule PlausibleWeb.RequireLoggedOutPlug do
cond do
conn.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

Loading…
Cancel
Save