app/helpers/sessions_helper.rb
# Keeps a persistent session for a user.
# Code based on Michael Hartl's Rails Tutorial, Chapter 8
# https://3rd-edition.railstutorial.org/book/log_in_log_out#code-remember_method
Keeps a persistent session for a user.
Keeps a persistent session for a user .
def remember(user)
      user.remember
      cookies.permanent.signed[:user_id] = user.id
      cookies.permanent[:remember_token] = user.remember_token
    end
def remember ( user ) user . remember cookies . permanent . signed [ :user_id ] = user . id cookies . permanent [ :remember_token ] = user . remember_token end
Keeps a persistent session for a user.
Keeps a persistent session for a user .
user
<not_specific>