devise icon indicating copy to clipboard operation
devise copied to clipboard

Cannot keep session only in some ios safari browser

Open yoshi42662 opened this issue 10 years ago • 4 comments

Overview

I'm using devise and having trouble with the session. In my iPhone using safari browser, I can keep session even when closing the tab and terminate the safari app with double pushing home button and flip the safari app.

In the login page, remember me param is always set to be true in the hidden field and I have session kept even when I close the tab and terminate the app.

However I got a report that after logged in, some users cannot keep session when they close the tab and terminate safari app.

I need help and thanks for your tips.

yoshi42662 avatar Apr 23 '16 07:04 yoshi42662

@yoshi42662 How did you fix this issue?

pranav7 avatar Mar 08 '18 11:03 pranav7

Yeah - we're getting this too. Anyone know of a fix for this?

yangez avatar Jun 13 '18 21:06 yangez

@yangez I was able to identify why this was happening for us. Since I had removed remember_me from the form, it wasn't being set while creating the session. A simple fix might be to hardcode it so that it's always true.

pranav7 avatar Jun 14 '18 05:06 pranav7

@yogeshjain999 You could try setting expire_at option in Rails.application.config.session_store. iOS safari does not save a session cookie on the persistent storage if there is no expiry date. iOS resets in-app cookies after 24hours and which lead to deletion of those which are without the expiry

akshay-soni avatar Aug 08 '19 20:08 akshay-soni