[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Javascript include reading cookies across domains?

Posted on 2008-11-04
1
Medium Priority
?
263 Views
Last Modified: 2012-05-05
We use Netsuite for our CRM/ERP System.  Our Contact form on our website is actually served up from Netsuite (https://forms.netsuite.com/app/site/crm/externalleadpage.nl?compid=TSTDRV353218&formid=3&h=c9cfe3394a58a39a833e&category=3&leadsource=99995).

That form, while hosted at Netsuite, refers to a javascript include on our site.  This javascript reads a cookie and sets the phone number based up on the referring site.  The cookie is not being found from the javascript.

Is there any way for a cookie to be read across domain names?  I had thought since the include file is on our domain - it would read the cookie.  I guess not.

Thanks.

Jennifer
0
Comment
Question by:carecorejen
1 Comment
 
LVL 6

Accepted Solution

by:
dwaynecharrington earned 1000 total points
ID: 22883329
Cookies cannot be read from another server. This is a security limitation of JavaScript and you'll have to go around it another way. There are definitely other ways to do this. Cookies can only be accessed by the domain they're created on.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question