mercredi 29 juillet 2015

i am migrating an application from rails 2.3 to rails 3.1, most of it is done but there is a issue, when the session get expired and i reload the page instead of redirecting me to login page i am getting a error

undefined method `size' for ActionDispatch::Cookies::CookieJar:0x007fa415c12670>

here is the code where i am getting the error

def access_denied
  respond_to do |accepts|
    accepts.html do
      test_location
      if cookies.size==0 && request.host == "somedomain.com"
        redirect_to "/cookies_disabled.html"
      else
        redirect_to new_session_url
      end
    end
    accepts.js do
      render :text => "window.location.href = '#{new_session_url}';"
    end
  end
  false
end  

any help will be appriciated, Thanks.

Aucun commentaire:

Enregistrer un commentaire