we shouldn't need this. Replace with:   session[:user_id] = @user.id    ...That should do the trick.