InAppBrowser cookies cleared on Android upon window close

4 posts, 0 answers
  1. Giancarlo
    Giancarlo avatar
    9 posts
    Member since:
    Jul 2015

    Posted 02 Nov 2015 Link to this post

    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.
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 05 Nov 2015 Link to this post

    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.

     
  3. Giancarlo
    Giancarlo avatar
    9 posts
    Member since:
    Jul 2015

    Posted 13 Nov 2015 in reply to Tina Stancheva Link to this post

    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');


  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 18 Nov 2015 Link to this post

    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.

     
Back to Top