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 8964687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:38:42+00:00 2026-06-15T16:38:42+00:00

I was working on jsonP to send data from a cookie, from a domain

  • 0

I was working on jsonP to send data from a cookie, from a domain A to a domain B. It works well, but my question is not here. I just realize that if I only put a script tag on my domain B pointing to my domain A, all the cookies of my domain A are set on my domain B.

Example: I put this tag on my domain B :

<script src="http://mydomainA.com/"></script>

Only with that, all the cookies of my domain A are set on my domain B.
My question is, is it normal? I thought cookie need some hacks to be cross domain, but i didn’t think it was that easy.

Sorry for my bad english, and apologize if my question is stupid or if it has been asked before.

Thanks in advance.

  • 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-06-15T16:38:43+00:00Added an answer on June 15, 2026 at 4:38 pm

    Cookies are simply headers in HTTP requests. When the browser requests

    GET /foo
    Host: a.com
    

    it receives a HTML document, which contains a <script> tag hosted on another domain. So it fires another request:

    GET /script.js
    Host: b.com
    Cookie: foobarbaz
    

    and it can certainly append cookies for domain b.com, if any. This means that the last time the browser contacted b.com, the HTTP response contained an header like

    ...
    Set-Cookie: foobarbaz
    ...
    

    and so subsequent requests to the same domain will maintain the session. When the browser requests another resource to a.com such as

    GET /bar.jpeg
    Host: a.com
    

    the cookie foobarbaz set by b.com will not be sent along with the request, so the scripts on a.com don’t have access to data from b.com.

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

Sidebar

Related Questions

i am working with JSON to send data to and from my server ,
Hi I am using jquery to get data from mysql. It works wonderfully but
I'm working with JSONP trying to fetch some results from the WOT API. See
i use json_encode to send back data from php to jquery through ajax. and
I have tried many ways of executing this but its not happening .. here
For some reason my form is working in every browser but Internet Explorer. Here
I'm calling 2 JS functions(Ajax) each of which are returning data from the server.But
I am working with JSON. when I am Passing data for serialization at that
Currently i am working in iPhone application, Using JSON to send a request and
I have a form, in which I need to send data selected via AJAX

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.