Skip to content

Instantly share code, notes, and snippets.

@dakatsuka
Created November 21, 2010 13:42
Show Gist options
  • Save dakatsuka/708745 to your computer and use it in GitHub Desktop.
Save dakatsuka/708745 to your computer and use it in GitHub Desktop.
Rails3のSessionと共存するためのモンキーパッチ
module ActionDispatch
module Flash
class FlashHash < Hash
def method_missing(m, *a, &b)
end
end
end
end
module ActionController
module Session
class CookieStore
private
def unmarshal(cookie)
if cookie
data = persistent_session_id!(@verifier.verify(cookie))
data.symbolize_keys!
end
rescue ActiveSupport::MessageVerifier::InvalidSignature
nil
end
def requires_session_id?(data)
if data
data.respond_to?(:key?) && !data.key?(:session_id) && !data.key?("session_id")
else
true
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment