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

  • SEARCH
  • Home
  • 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 8634675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:46:54+00:00 2026-06-12T09:46:54+00:00

Im using getJSON to send data from a domain to another domain. Here’s the

  • 0

Im using getJSON to send data from a domain to another domain.

Here’s the example:
Domain A (www.a.com) sends data using jQuery getJSON() to Domain B (www.b.com)
Domain B contains all the php scripts to parse the data.

For security reasons , i want to make sure the data sender is domain A and not others.
I read up a lot of posts and searched , i came across $_SERVER[‘HTTP_REFERER’] for php. However , i noticed a lot saying this is not the best way and some browsers dosent support it.

Then i came across another saying using cookies and access token which confuses me further.
Well i hope someone is able to point me into the right direction.

here’s the jquery script im using to send the data over to dmoain B

$.getJSON('b.com/parse.php?data=' + data +'&callback=?', function(data) {
//do something
});
  • 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-12T09:46:56+00:00Added an answer on June 12, 2026 at 9:46 am

    I want to make sure the data sender is domain A and not others

    There is no way to reliably detect if a request was trigged by JavaScript running in a page hosted on a particular domain.

    using cookies and access token which confuses me further

    This is an indirect approach. Essentially the process would work something like this:

    1. One of the two servers generates an access token (along with an expiry time)
    2. It sends that token to the other server
    3. The server hosting the application sends that token to the client
    4. The client makes a request to the server hosting the data and includes that token in the URI
    5. The server hosting the data recognises the token and authorises the client (possibly setting a cookie so that the token persists automatically)

    The token can still be extracted from the application, since it has to be given to the client. However, that has to be done by someone with full access to the client, so it can’t be done by a third party website that wants to access your data.

    Such a website could access the site hosting the application, get an identification token, and then access the site hosting the data. There are ways to defend against this…

    If the request to the data site is being made by the server, then it will probably be making an unusually high number of requests from a given ip address. You can rate limit it. (They can then work around this by cycling through different source ips).

    If the request is being made by web browsers, then the request for the token will have come from a different IP address to the request for the data. You can lock the token autorisation to a given IP address. This will, however, break for users who access via proxy servers (e.g. quite a lot of mobile users and people using AOL (last time I heard anything about how AOL’s servers were configured anyway)).

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

Sidebar

Related Questions

I'm using JQuery's getJSON method to retrieve some data from an MVC controller. [AcceptVerbs(HttpVerbs.Get)]
I am trying to retrieve some data from a database using jQuery's $.getJSON method
I'm attempting to send a dictionary from jQuery to Django using a getJSON call:
I am attempting to pase a a JSON data using the JQuery getJSON function.
I'm using jQuery.getJSON(...) to make a call/process response for a slightly large data set.
I have a question similar to here: using jquery.getJson with Google's GeoCoding HTTP Service
I have a program that gets a JSON from the server using getJSON and
I'm using jquery $.getJSON to retrieve list of cities. Everything works fine, but I'm
When using this code: <script> $(document).ready(function () { $.getJSON(http://twitter.com/statuses/user_timeline/USERNAME.json?callback=?, function(data) { if(data[0].text.length > 107)
I'm using this code: <script> $(document).ready(function () { $.getJSON(http://twitter.com/statuses/user_timeline/USERNAME.json?callback=?, function(data) { $(.show_tweet).html(data[0].text); }); });

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.