Use session.delete to remove entries instead of assigning nil
authorTom Hughes <tom@compton.nu>
Wed, 1 Jun 2011 09:17:54 +0000 (10:17 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 1 Jun 2011 09:17:54 +0000 (10:17 +0100)
app/controllers/application_controller.rb
app/controllers/user_controller.rb

index 122349a..1d3297d 100644 (file)
@@ -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"
index 97b0de7..283e119 100644 (file)
@@ -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]