Single Sign On Service - Cookies being persistent

Hi All,

I’m writing a business app to list news articles, replicate most of instagrams functionality and some other screens, mostly it’s working really but I’ve come across a problem I’m not sure how to solve.

I’m using a widget.newWebView() native.newWebView to push the user to a SSO service, where they do through that just fine then return to the app. I’m listening to the URL changes on the browser object and when the user gets to a secure page I move the browser off the screen but don’t destroy it (x=-1000) thinking that this would keep the cookies live for that browser. The browser object is set in main.lua and reused (as a global var) throughout the app to load secure pages knowing the SSO Cookies are present whilst that browser object is active. That’s working fine.

When I close app (fully close) or restart my phone(s) I am forced to login again because the browser object is destroyed and the SSO cookie must not be present anymore.

Is there any way or does anyone have an idea how I can force the cookies to be persistent across app launches, device restarts etc…so the user doesn’t have to sign in again and again to read articles or access secure content when using the app.

Any help would be greatly appreciated.

I don’t know of a way to keep cookies persistent across sessions.  I don’t know how your SSO service works, but it may be a case of where you have to store the credentials locally and see if they have a REST API or something that lets you use network.request() to manage the login instead of a webView.

Rob

I don’t know of a way to keep cookies persistent across sessions.  I don’t know how your SSO service works, but it may be a case of where you have to store the credentials locally and see if they have a REST API or something that lets you use network.request() to manage the login instead of a webView.

Rob