Cookie support

7 posts, 0 answers
  1. Darcy
    Darcy avatar
    1 posts
    Member since:
    Jun 2012

    Posted 29 Jun 2012 Link to this post

    If there is already cookie support, then ignore the rest of my post, but tell me how to do it :)

    My understanding is that if I want to be able to accept 3rd party cookies (e.g.: forms authentication), then I need to edit the cordova phonegap_delegate.m file.

    I can't figure out how to do that, so if there is a way, then I'd appreciate it if you could share.

    What I would really like to see is that it is a configuration setting that can be set for each project.

    Great product by the way!

  2. sdobrev
    sdobrev avatar
    54 posts
    Member since:
    Sep 2012

    Posted 29 Jun 2012 Link to this post

    Hi Darcy,

    Cookies on iOS 5+ should work without problem, because the default cookie accept policy is always, unless some other application has already changed it. You can read more about it on Apple's site.

    If you want to modify cookies you can use the jquery-cookie plugin.

    Hope this helps.
  3. Ashish
    Ashish avatar
    5 posts
    Member since:
    Nov 2012

    Posted 17 Feb 2013 Link to this post

    It doesn't look like cookie is available in getAllResponseHeaders. Below is the output (no cookie)

    Date: Mon, 18 Feb 2013 05:45:56 GMT
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Content-Length: 22560
    Server: Microsoft-IIS/8.0
    Content-Type: text/html; charset=utf-8
    Cache-Control: private


    function getHtml(){
      var geturl;
       geturl = $.ajax( {
        url: 'http://www.MYSITE.COM?ctl=login',
        type: 'get',
        success: function( data )
        {
           //console.info($.cookie());
            console.info(geturl.getAllResponseHeaders());
        }
    } );    
        
    }

  4. Ashish
    Ashish avatar
    5 posts
    Member since:
    Nov 2012

    Posted 18 Feb 2013 Link to this post

    BTW, this output is from Icenium Graphite Simulator. The debugging tool in the Simulator doesn't show any cookie as well. However, when I run the url in Chrome. I do see the cookies in Chrome's developer tool. I need to access the antiforgery cookie from WebAPI to be able to make POST ajax calls. I can't seem to see cookies in the Simulator. Is it supported? Any info will be greatly appreciated.
  5. Jordan
    Admin
    Jordan avatar
    197 posts

    Posted 20 Feb 2013 Link to this post

    Hi Ashish,

    Thank you very much for reporting issue about cookie values not present in simulator!
    We managed to reproduce and logged it for priority fixing.
    If applicable for you test cookies on real device for now.

    Also try to use ajax requests with authentication by adding xhr custom header as shown bellow.
    It appears to me that it may work in your scenario? This way no need to get cookies they shall be attached to subsequent requests to your back-end automagically.
    More info here: http://www.html5rocks.com/en/tutorials/cors/#toc-withcredentials

    $.ajax( {
    ...
      xhrFields: {
        withCredentials: true
      }
    ...


    All the best,
    Jordan
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Pluralsight.
  6. Ashish
    Ashish avatar
    5 posts
    Member since:
    Nov 2012

    Posted 07 Oct 2013 Link to this post

    @Jordan - Has this been resolved in the simulator?
  7. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 09 Oct 2013 Link to this post

    Hello Ashish,

    The problem is still present in the simulator, please test cookies by deploying on your actual device.

    Regards,
    Steve
    Telerik
    You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
    Looking for tips & tricks directly from the Icenium team? Check out our blog!
    Share feedback and vote for features on our Feedback Portal.
Back to Top