Created
November 21, 2010 13:42
-
-
Save dakatsuka/708745 to your computer and use it in GitHub Desktop.
Rails3のSessionと共存するためのモンキーパッチ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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