Cookies Disabled in Lollipop

2 posts, 0 answers
  1. John
    John avatar
    1 posts
    Member since:
    May 2015

    Posted 31 May 2015 Link to this post

    I am trying an sample app using the icenium with session authentication.

    The app working working fine in Kitkat and below android devices.

    But in Lollipop the session is not maintained for each requests.

    I googled these thinks and i found the following, In Lollipop Cookies is disabled by default,

    and they give the following code to fix(Please refer this link Code to Fix)

    But we don't have any .java file in icenium project right, then how can we apply this code in icenium phonegap?

  2. Martin Yankov
    Martin Yankov avatar
    177 posts

    Posted 03 Jun 2015 Link to this post

    Hello John,

    Yes, this was introduced by Android, because all web views share their cookies. This means that you could get the cookies from one app to authenticated in another. While this sounds cool, it actually is a very bad practice since third party apps have unrestricted access too. This is not the app way and we decided to not let this bad practice be available for new apps.

    If you have an older app and don't want to rework it to use local storage instead of cookies, then your option is to manually change the target sdk for Android. Right click on your project -> Edit Configuration -> Android -> AndroidManifest.xml. Change the target sdk to 14 which is Android 4.0. This means that your app will be built with the older SDK which does not restrict the cookies.

    I hope this helps.

    Martin Yankov

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

Back to Top