Skip to content

Instantly share code, notes, and snippets.

@tyabe
Created June 29, 2011 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyabe/1054490 to your computer and use it in GitHub Desktop.
Save tyabe/1054490 to your computer and use it in GitHub Desktop.
Rails-3.0.3 + jpmobile-0.1.4 ( + devise-1.1.5 ) でCookie非対応の携帯でログインできるようにするパッチ
#
# config/initializers配下におく
#
if defined?(Jpmobile)
class ActionDispatch::Request
def reset_session
session.destroy if session && session.respond_to?(:destroy)
@env['action_dispatch.request.flash_hash'] = nil
# session.inspect を挟むと session_options[:id] で
# セッションIDが取得できるようになる?
session.inspect
self.session = {}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment