From c4f7a8346a7e42643cc7ba5c114b6f2be43aff80 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 1 Jun 2011 10:17:54 +0100 Subject: [PATCH] Use session.delete to remove entries instead of assigning nil --- app/controllers/application_controller.rb | 2 +- app/controllers/user_controller.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 122349aff..1d3297d16 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -11,7 +11,7 @@ class ApplicationController < ActionController::Base @user = User.find(session[:user], :conditions => {:status => ["active", "confirmed", "suspended"]}) if @user.status == "suspended" - session[:user] = nil + session.delete(:user) session_expires_automatically redirect_to :controller => "user", :action => "suspended" diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 97b0de73c..283e11936 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -272,9 +272,9 @@ class UserController < ApplicationController if token token.destroy end - session[:token] = nil + session.delete(:token) end - session[:user] = nil + session.delete(:user) session_expires_automatically if params[:referer] redirect_to params[:referer] -- 2.39.5