in reply to multiple domain cookie

You can't all of the current web browsers disallow cross security site cookie meddling. The only way this will work is if you have both sites be on the same domain. then you set the cookie for the domain not the hostname. If both sites must be on different domains yo will need to bridge the sites with a session encoded in the URL.


-Waswas

Replies are listed 'Best First'.
Re: Re: multiple domain cookie
by bear0053 (Hermit) on Oct 20, 2003 at 19:14 UTC
    what do you mean by session encoded in the url?

      Instead of sending the data in the cookie, save the data to a database with a randomly generated session ID (I usually use Data::UUID for this). The ID is simply put into the URL string, e.g.:

      http://www.example.com/your_program.cgi?id=abcdefg

      When the CGI runs, it grabs the session ID value off the parameter list and get's the saved data from the database. If the user is using a form, you can put the ID in a hidden field instead.

      You should be using this method even if you use cookies instead (by putting the session ID as the cookie value). I've rarely seen a good excuse for not doing so besides sloppy coding.

      There are various modules for helping you do this. I've heard of CGI::Session before, but I've never used it, so I won't comment on it.

      ----
      I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
      -- Schemer

      :(){ :|:&};:

      Note: All code is untested, unless otherwise stated