Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With null_session, cookies.signed raises exception #9168

Closed
js1888 opened this issue Feb 4, 2013 · 3 comments
Closed

With null_session, cookies.signed raises exception #9168

js1888 opened this issue Feb 4, 2013 · 3 comments

Comments

@js1888
Copy link

js1888 commented Feb 4, 2013

In Edge Rails (443be75), using cookies.signed with a null_session raises "TypeError (can't convert nil into String)" at "rails/activesupport/lib/active_support/key_generator.rb:21:in `pbkdf2_hmac_sha1'".

# application_controller.rb
class ApplicationController < ActionController::Base
  protect_from_forgery with: :null_session
  def index
    cookies.signed[:foo] = 'foo'
  end
end

# routes.rb
Railstest::Application.routes.draw { post '/' => 'application#index' }

$ curl -d mydata http://localhost:3000
@a-chernykh
Copy link
Contributor

I've tried to reproduce your case, but :null_session with signed cookies works just fine for me. I've tried with the following Gemfiles:

source 'https://rubygems.org'
gem 'rails', :git => 'git://github.com/rails/rails.git'
source 'https://rubygems.org'
gem 'rails', :git => 'git://github.com/rails/rails.git', :ref => '443be75'

@js1888
Copy link
Author

js1888 commented Feb 5, 2013

I just reproduced it with these steps. Here's the response and stack trace. Here's my Gemfile and Gemfile.lock. Anything look wrong or weird with my setup?

spastorino added a commit that referenced this issue Feb 8, 2013
…sion

Fix #9168 Initialize NullCookieJar with all options needed for KeyGenerator
@spastorino
Copy link
Contributor

I've removed the CHANGELOG entry b5645d0 because there's no need to provide that for a feature that was not released yet.
Sorry for making you go back and forth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants