<commit_before>module SessionsHelper
  def login(user)
    session[:current_user_id]=user.id
    redirect_to dashboard_url
  end
  
  def current_user
    @current_user ||= User.find(session[:current_user_id]) if session[:current_user_id]
    rescue ActiveRecord::RecordNotFound
  end
   
  def logged_in?
    !current_user.nil?
  end
   
  def logout
    self.current_user= nil
    cookies.delete(:remember_token)
  end

  def authenticate_user!
    if !current_user
      flash[:alert] = 'You need to login before accessing this page!'
      redirect_to login_path
    end
  end 
end<commit_msg>Fixed logout action to user session[:current_user_id]<commit_after>module SessionsHelper
  def login(user)
    session[:current_user_id]=user.id
    redirect_to dashboard_url
  end
  
  def current_user
    @current_user ||= User.find(session[:current_user_id]) if session[:current_user_id]
    rescue ActiveRecord::RecordNotFound
  end
   
  def logged_in?
    !current_user.nil?
  end
   
  def logout
    session[:current_user_id]=nil      
  end

  def authenticate_user!
    if !current_user
      flash[:alert] = 'You need to login before accessing this page!'
      redirect_to login_path
    end
  end 
end
{'fraction_non_alphanumeric': 0.07349298100743187, 'fraction_numerical': 0.0, 'mean_word_length': 3.5223880597014925, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '99199', 'n_tokens_mistral': 395, 'n_tokens_neox': 386, 'n_words': 92}