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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:42:45+00:00 2026-06-12T02:42:45+00:00

I would like a concrete example in an answer if possible. For explanations sake

  • 0

I would like a concrete example in an answer if possible.

For explanations sake we have three players here.

  • My Server (myserver.com)
  • Client Server (myclient.com)
  • Client User (accessing data through myclient.com)

I’m making a web service available to my clients that allows them to retrieve their data in JSON format. In order for their websites to work they have to use the standard XOR workarounds – either making the request server-side or relying on me to set

Access-Control-Allow-Origin: http://myclient.com

So two part question here. First, why do I set the origin policy at myserver.com? Why does my server care who it serves content up to? Shouldn’t it be myclient.com that sets this? Concrete example here would be great.

Part two, I understand that JSONP works around this, but I’m worried about using it because I don’t understand the security implications from part one. What is the point of JSONP if I can just set Access-Control-Allow-Origin: *?

  • 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-12T02:42:46+00:00Added an answer on June 12, 2026 at 2:42 am

    Lots of questions!

    1. JSONP is definitely dangerous if you intend to serve user-specific content. If the content the server is serving is completely public, and (probably) read-only, JSONP is a wise choice. Don’t use it for anything that assumes a ‘logged in state’ or authentication/authorization.

    2. CORS is definitely much better than JSONP, but it’s not supported in every (older) browser. If you want to support as much as possible, you will need some kind of fallback. CORS allows you to do requests other than GET, which greatly improves flexibility.

    3. The reason the target server needs to allow this, is mainly because javascript running on domain A, should not be able to access domain B. If domain A could ‘allow’ this, it implies you could create javascript applications that have access to the sandbox of any public server. Only the owner of domain B can explicitly allow the owner of domain A to access their content.

    4. Your argument (why does domain B care who accesses their resources) would normally be valid. But this is not to protect domain B, it is to protect the end-user. Domain A should not be allowed to perform requests on behalf of the end-user to Domain B without explicit permission.

    And just to be sure: unless you understand the security implications of JSONP quite well, CORS is likely a much safer choice.

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

Sidebar

Related Questions

I would like to verify that concrete text for example hello exists inside concrete
I might be using incorrect terminology, but here is example what I would like
I would like to know whether it is possible to write code that would
I haven't found a concrete answer as to whether this is possible, but it
Given the following contrived example: I would like to query my data for all
I have an image and I would like to have it so when I
To give a concrete example of what I mean: Imagine I have an HTML
I would like to use GWTP (GTP-Platform) on the GAE, but I have not
Can someone please derive a concrete example from the following: http://www.urdalen.com/blog/?p=210 ..that shows how
I would like to Mock the System.IO.FileInfo.Extension Method and have it return .xls but

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.