You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: login_controller.rb
    path of file: ./repos/tracks/app/controllers
    
    the code of the file until where you have to start completion: class LoginController < ApplicationController
  include Common

  layout 'login'
  skip_before_action :set_session_expiration
  skip_before_action :login_required
  before_action :login_optional
  before_action :get_current_user
  before_action :set_theme

  protect_from_forgery :except => [:check_expiry, :login]

  def login
    @page_title = "TRACKS::Login"
    c
    
  def handle_post_success
    session['user_id'] = @user.id
    # If checkbox on login page checked, we don't expire the session after 1 hour
    # of inactivity and we remember this user for future browser sessions
    session['noexpiry'] = params['user_noexpiry']
    msg = (should_expire_sessions?) ? "will expire after 1 hour of inactivity." : "will not expire."
    notify :notice, "Login successful: session #{msg}"
    cookies[:tracks_login] = { :value => @user.login, :expires => Time.zone.now + 1.year, :secure => SITE_CONFIG['secure_cookies'] }
    unless should_expire_sessions?
      @user.remember_me
      cookies[:auth_token] = { :value => @user.remember_token, :expires => @user.remember_token_expires_at, :secure => SITE_CONFIG['secure_cookies'] }
    end
    redirect_back_or_home
  end