Skip to content

Instantly share code, notes, and snippets.

@matsuda
Created January 17, 2011 05:46
Show Gist options
  • Save matsuda/782534 to your computer and use it in GitHub Desktop.
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非対応の携帯でログインできるようにするパッチ
#
# 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
@matsuda
Copy link
Author

matsuda commented Mar 10, 2011

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