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

Cookie support

6 Answers 190 Views
Feedback & Suggestions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Darcy
Top achievements
Rank 1
Darcy asked on 29 Jun 2012, 06:55 PM
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!

6 Answers, 1 is accepted

Sort by
0
sdobrev
Top achievements
Rank 1
answered on 30 Jun 2012, 04:24 AM
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.
0
Ashish
Top achievements
Rank 1
answered on 18 Feb 2013, 05:54 AM
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());
    }
} );    
    
}

0
Ashish
Top achievements
Rank 1
answered on 18 Feb 2013, 04:07 PM
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.
0
Jordan
Telerik team
answered on 20 Feb 2013, 11:28 AM
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.
0
Ashish
Top achievements
Rank 1
answered on 08 Oct 2013, 03:01 AM
@Jordan - Has this been resolved in the simulator?
0
Steve
Telerik team
answered on 09 Oct 2013, 06:21 AM
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.
Tags
Feedback & Suggestions
Asked by
Darcy
Top achievements
Rank 1
Answers by
sdobrev
Top achievements
Rank 1
Ashish
Top achievements
Rank 1
Jordan
Telerik team
Steve
Telerik team
Share this question
or