Saturday, August 3, 2024
HomeiOS Developmentios - Persist session (cookies) in react-native-webview with rails

ios – Persist session (cookies) in react-native-webview with rails


I am attempting to maintain my customers logged in once they re-open the app after closing it.

I exploit ruby on rails on the server and react native with react-native-webview on the cell facet.

It is solely on iOS proper now however wish to make it for Android as nicely.

Here’s what I attempted:

      sharedCookiesEnabled={true}
Rails.software.config.session_store :cookie_store, 
                                       key: '_code_session',
                                       area: :all / "dev.codedorian.com", 
                                       safe: true / false, 
                                       httponly: true / false, 
                                       same_site: :strict / :lax / :none

Right here is my webview:

    <WebView
      onMessage={onMessage}
      ref={webViewRef}
      supply={{uri: CODE_URL}}
      onLoadStart={replace}
      onLoad={replace}
      onLoadEnd={replace}
    />

(the updates is perhaps overkill)



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments