Error jquery s ajax method not sending my session cookie

0 votes
After logging in via $.ajax() to a site, I am trying to send a second $.ajax() request to that site - but when I check the headers sent using FireBug, there is no session cookie being included in the request.

What am I doing wrong?
Aug 25, 2020 in Java-Script by kartik
• 37,510 points
2,584 views

1 answer to this question.

0 votes

Hello @kartik,

AJAX calls only send Cookies if the url you're calling is on the same domain as your calling script.

This may be a Cross Domain ProblemOperating in the cross - domain scenario. During login remote server is returning Set-Cookie header along with Access-Control-Allow-Credentials set to true.

The next ajax call to remote server should use this cookie.CORS's Access-Control-Allow-Credentials is there to allow cross-domain logging.

Hope it helps!!
Thank you!!

answered Aug 25, 2020 by Niroj
• 82,880 points

Related Questions In Java-Script

+1 vote
1 answer

Error:SQL “between” not inclusive

Hello, It is inclusive. You are comparing datetimes to dates. ...READ MORE

answered May 28, 2020 in Java-Script by Niroj
• 82,880 points
540 views
0 votes
1 answer

Error:Invariant Violation: _registerComponent(…): Target container is not a DOM element

Hii @kartik, Basically what you done is right, ...READ MORE

answered Jun 8, 2020 in Java-Script by Niroj
• 82,880 points
2,513 views
+1 vote
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
21,878 views
0 votes
1 answer

What is redirection in Laravel?

Named route is used to give specific ...READ MORE

answered Mar 18, 2020 in Laravel by Niroj
• 82,880 points
2,681 views
0 votes
1 answer

How to install Laravel via composer?

Hello, This is simple you just need to ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
2,542 views
+1 vote
1 answer

What are named routes in Laravel and How can specify route names for controller actions?

Hey @kartik, Named routing is another amazing feature of ...READ MORE

answered Mar 23, 2020 in Laravel by Niroj
• 82,880 points
41,726 views
0 votes
1 answer

How to trigger jquery.ajax() error callback based on server response, not HTTP 500?

Hello @kartik, The error callback will be executed ...READ MORE

answered Jun 18, 2020 in Java-Script by Niroj
• 82,880 points
16,310 views
0 votes
1 answer

jQuery AJAX fires error callback on window unload - how do I filter out unload and only catch real errors?

Hello, In the error callback or $.ajax you have three ...READ MORE

answered Apr 27, 2020 in Java-Script by Niroj
• 82,880 points
3,712 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP