Software, your way.
burger menu icon
WillMaster

WillMaster > LibraryCookies and Browser Interaction

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Setting Cookies at Other Domains

Cookies can be set only by the domain the browser retrieves content from. Content is text, image, style, JavaScript, videos, any content a web page can publish.

It used to be that content obtained from other web sites could set their own cookies. Those are called third-party cookies because the cookies are set by web sites different than the domain in the browser's address bar.

Third-party cookies are unreliable anymore.

Google Chrome will be blocking third-party cookies. Firefox and Safari already have. (More information is at this ad-heavy vox.com web page.)

There are reasons to use third-party cookies — other than for advertising purposes. Here are a few:

  • Logging in at one domain for access at another.

  • Shopping where discount depends on whether a certain message at another site was seen.

  • Sharing preferences between two or more related websites.

With a bit of creativity, most needs can be met by implementing alternative technology.

I'll examine an alternative. It requires you to have admin access for all domains that will be setting a cookie.

This alternative won't be practical for all requirements. It is an example only, included here as a demonstration that alternatives generally can be found.

An Alternative

The current/past method is the browser at a page on website A loads an image from website B. Website B sets a third-party cookie.

An alternative is to send the browser to website B long enough to set a cookie. Then send the browser back to website A.

Instead of setting a cookie when an image or other file is loaded (a method to set third-party cookies), the browser actually lands at website B to get the cookie set. (When a cookie is set at a domain that is in the browser's address bar, the website being visited, it is a first-party cookie, not a third-party.)

To reiterate, this alternative method sends the browser directly to website B, which then sets a first-party cookie. Website B sends the browser back to website A. Website A can now load the image from website B without setting a cookie — because the cookie has already been set.

Probably alternatives can be found for most current third-party cookie implementations. It is just not as simple as it used to be.

(This article first appeared with an issue of the Possibilities newsletter.)

Will Bontrager

Was this article helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method

All information in WillMaster Library articles is presented AS-IS.

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2024 Will Bontrager Software LLC