Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6121829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:49:42+00:00 2026-05-23T15:49:42+00:00

I have got CORS working on my current project, although one thing I cannot

  • 0

I have got CORS working on my current project, although one thing I cannot seem to get working correctly is the cookies.

Now I get the cookie fine, the server issues it and sends it down and firefox accepts it, I can see it in the firebug cookies section. However when I make subsequent calls to that service it doesnt seem to send the cookie in the header…

GET /some/entity/ HTTP/1.1
Host: localhost:1837
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20100101 Firefox/5.0
Accept: */*
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://localhost:6879
Origin: http://localhost:6879

Do I need to do anything special with my ajax call?

var ajaxOptions = {
    url: serviceResourceUrl,
    type: "get",
    dataType: "json",
    success: successCallback,
    error: failedCallback,
    xhrFields: { withCredentials: true }
};

$.ajax(ajaxOptions);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:49:43+00:00Added an answer on May 23, 2026 at 3:49 pm

    Try using the beforeSend property instead of xhrFields. In your case:

    var ajaxOptions = {
        url: serviceResourceUrl,
        type: "get",
        dataType: "json",
        success: successCallback,
        error: failedCallback,
        beforeSend: function(xhr){
          xhr.withCredentials = true;
        }
    };
    
    $.ajax(ajaxOptions);
    

    You can learn more here: Sending credentials with cross-domain posts?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got one more error in web xml -Cannot resolve the name 'javaee:web-appType'
I have got my HTML5 project a bit further along - I have one
We have got a custom MembershipProvider in ASP.NET . Now there are 2 possible
I have got some code to load an assembly and get all types, which
I have got two movieclips on the main timeline. First one is envelope_mc and
I have got a tableViewController with one section and one cell. How can I
I have got some problem implementing bullet physics into my opengl game. The thing
I have got the following pulled from an array. [TheBeautifulSouth/2-15 One Last Love Song.m4a]
I have got experience working in Spring framework, but i find it very difficult
I have got a Qt project which I am configuring and building using CMake.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.