Created
January 17, 2011 05:46
-
-
Save matsuda/782534 to your computer and use it in GitHub Desktop.
Rails-3.0.3 + jpmobile-0.1.4 ( + devise-1.1.5 ) でCookie非対応の携帯でログインできるようにするパッチ
This file contains 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
# | |
# config/initializers配下やlib配下においてinclude | |
# | |
if defined?(Jpmobile) | |
class ActionDispatch::Request | |
def reset_session_with_jpmobile | |
reset_session_without_jpmobile | |
if self.mobile? | |
self.session_options[:id] = ActiveSupport::SecureRandom.hex(16) | |
if Rails.application.config.session_store == ActiveRecord::SessionStore | |
@env[ActiveRecord::SessionStore::SESSION_RECORD_KEY] = nil | |
end | |
end | |
end | |
alias_method_chain :reset_session, :jpmobile | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
プラグイン化
https://rubygems.org/gems/galapagos_mobile