app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def authenticate
    puts "#{Time.now.to_i} : #{session[:login_expires_at].to_i}"
    puts "#{session[:token]}"
    if Time.now.to_i < session[:login_expires_at].to_i &&
       session[:token] == authenticity_token
         true
    else
      redirect_to login_path
      false
    end
  end
def authenticate puts "#{Time.now.to_i} : #{session[:login_expires_at].to_i}" puts "#{session[:token]}" if Time . now . to_i < session [ :login_expires_at ] . to_i && session [ :token ] == authenticity_token true else redirect_to login_path false end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .