Closed powermike closed 9 years ago
I would try to investigate if the tablet is sending the proper session / cookies. Maybe it is dropping stuff it is not supposed to.
I tried to put this in application controller:
prepend_before_action :session_data
prepend_after_action :session_data
protected
# For Android sessions
def session_data
puts '\n\n\n\n'
puts session.inspect
puts '\n\n\n\n'
end
This is the log I have for the second page:
It is just saying the session isn't loaded. Try to access something in it, like session["foo"] before inspecting it! Also, try printing your cookies too!
I used this for debug:
prepend_before_action :session_data
prepend_after_action :session_data
protected
# For Android sessions
def session_data
logger.info '##### Start Debug session'
logger.info '# Session'
logger.info '# Accessing session'
logger.info "Contract ID from session: #{session[:contract_id]}"
logger.info '# Cookies'
logger.info cookies.inspect
logger.info '##### End Debug session'
end
First page log:
Second page logs:
I have no idea what is happening. We can clearly see the session is being deleted through "cache delete" entries but I have no idea what is triggering that. What is android sending that is making Rails or Devise think it should create a new session? Which session store are you using? Cookies or in memory? if you change the session store, does the bug persist?
I use dalli_store as session store.
I switched to cookie_store to test here the result:
On heroku:
On my mac with the android tablet:
As you can see it works on my mac but not on heroku. F...K!
Sorry, I still have no idea what is happening. :( Let us know if you find more info.
Closing this as it has been 4 months. It defintiely doesn't look like a Devise issue though as we are just relying on Rails session setup.
Hi,
Something very weird is happening to my app. I'm working on the mobile version so I test my app on iPhone/iPad/Android phone and Android tablet. Authentication works well on first three ones but not on Android tablet. Even weirder it works locally on my mac when I test it with the Android tablet :-(
The app is hosted on Heroku with Memcache to share session between dynos.
See the logs for Safari desktop version:
See the same action logs with the android tablet:
I updated my gems (bundle update)
Here is my Gemfile.lock
Here are my environnements settings:
development:
Staging config:
Obviously something special on heroku make it fails but only for Android tablet. Any idea what can I do to debug this ?
Thank you for your help.
Regards.