Project

General

Profile

Patch #9118 » 1013_cookie_symbol_to_s.patch

Jérémy Lal, 2011-09-13 00:11

View differences:

app/controllers/account_controller.rb
129 129
  
130 130
  def logout_user
131 131
    if User.current.logged?
132
      cookies.delete :autologin
132
      cookies.delete :autologin.to_s
133 133
      Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin'])
134 134
      self.logged_user = nil
135 135
    end
......
204 204
    # generate a key and set cookie if autologin
205 205
    if params[:autologin] && Setting.autologin?
206 206
      token = Token.create(:user => user, :action => 'autologin')
207
      cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now }
207
      cookies[:autologin.to_s] = { :value => token.value, :expires => 1.year.from_now }
208 208
    end
209 209
    call_hook(:controller_account_success_authentication_after, {:user => user })
210 210
    redirect_back_or_default :controller => 'my', :action => 'page'
    (1-1/1)