By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,405 Members | 1,579 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,405 IT Pros & Developers. It's quick & easy.

Cookies problem, I believe it has to do with domains?

P: n/a
Gretings, I hope someone can help me to clarify this:

I have an application with cookies, it works fine when I browse it.

The thing is that this app will be shared by different pages (different
domains). When I browse it from other domain (inside a frame).. It
stops working.

Is this because it is being called from a different domain? Shouldnt
work anyway because the app works by itself? It doesn´t share the
cookie with other pages.

I´ll apreciate any help on how could I solve this problem!

Greetings.

Drakon.

Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Drakon,
The thing is that this app will be shared by different pages (different
domains). When I browse it from other domain (inside a frame).. It
stops working.


Cookies can not be shared across domains. The cookie is normally set
for that domain only and the browsers will not allow other pages access
because it could be a huge security vunribility.

As for a workaround you could possibly send the current cookie to the
other page that is in another domain either by javascript or using php
and sending all of the items in the cookie with it.

This is the only thing I could see as a workaround.

Mike
Jul 17 '05 #2

P: n/a
*** ma************@gmail.com wrote/escribió (16 May 2005 08:09:54 -0700):
Is this because it is being called from a different domain?


Cookies are always attached to a domain and (optionally) a directory.
Several reasons for that:

* Browsers don't need to waste bandwidth sending *all* cookies stored in
the computer with every HTTP request.

* Sites don't overwrite other's cookies.

* Your private info stored in cookies is not sent to every site you visit.
If you need to create a cookie and read if from other sites, you can create
one different cookie per site (with the same value), but you must be aware
that some browsers block third-party cookies by default.


--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.