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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • martinsgattoni@gmail.com

    #1

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

    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.

  • Mike Willbanks

    #2
    Re: Cookies problem, I believe it has to do with domains?

    Drakon,[color=blue]
    > 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.[/color]

    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

    Comment

    • Alvaro G Vicario

      #3
      Re: Cookies problem, I believe it has to do with domains?

      *** martinsgattoni@ gmail.com wrote/escribió (16 May 2005 08:09:54 -0700):[color=blue]
      > Is this because it is being called from a different domain?[/color]

      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
      --

      Comment

      Working...