This is a migrated thread and some comments may be shown as answers.

InAppBrowser cookies cleared on Android upon window close

3 Answers 1554 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Giancarlo
Top achievements
Rank 1
Giancarlo asked on 02 Nov 2015, 07:24 PM
We are integrating our website within our mobile app. Crosswalk is being used for the WebView. There is a workflow in our app where the user is presented with a login page from our site, user logs in and is presented with some options, then the window is closed. At the end of the workflow the user is given the choice to proceed to the site or back to the app main page. This works great in iOS, the user is not prompted to login again. However, in Android, the user is unfortunately prompted to login again. Only thing I can think of is that the cookies are being cleared when close() is called on the InAppBrowser. I have tried using the Default WebView as well to no avail. Any insight would be appreciated.

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 05 Nov 2015, 04:59 PM
Hello Giancarlo,

The InAppBrowser allows you to control the browser's and session cookie cache with a few Android-specific options:
  • clearcache: set to yes to have the browser's cookie cache cleared before the new window is opened
  • clearsessioncache: set to yes to have the session cookie cache cleared before the new window is opened
Can you check the values of those properties in your application. Also, if you can share a code snippet of the window.open() implementation in your project I can test its behavior further on our side.

Regards,
Tina Stancheva
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Giancarlo
Top achievements
Rank 1
answered on 13 Nov 2015, 05:05 PM

Hi Tina,

Thanks for your reply, I was aware of the options and using them. However, there is a twist. Here is the issue, I believe this to be an InAppBrowser bug.

1) Open InAppBrowser with clearcache and clearsessioncache set to "yes".

 var myWindow = $window.open(url, '_blank', 'location=no,toolbar=no,clearcache=yes,clearsessioncache=yes,hidden=yes');

myWindow.show();

2) Start another InAppBrowser window with options omitted:

var myWindow = $window.open(url, '_blank''location=no,toolbar=no,hidden=yes');

myWindow.show();

That is where the problem is, you have to explicitly set the options to NO. This fixed the issue:

$window.open(url, '_blank''location=no,toolbar=no,clearcache=no,clearsessioncache=no,hidden=yes');


0
Tina Stancheva
Telerik team
answered on 18 Nov 2015, 03:28 PM
Hi Giancarlo,

Thank you for getting back to us and sharing your findings with the community. If you believe this is an issue in the InAppBrowser implementation, you can share your scenario in the InAppBrowser issue tracker.

If you have any other issues with your app or any questions regarding Telerik Platform and AppBuilder, don't hesitate to write back and let me know.

Regards,
Tina Stancheva
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
Apache Cordova
Asked by
Giancarlo
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Giancarlo
Top achievements
Rank 1
Share this question
or