Sharing a shopping cart between 2 sites...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CanardWC

    Sharing a shopping cart between 2 sites...

    Hello,

    Just a little problem. I want to share a shopping cart between 2 php sites
    for example foo and fii.
    There'is no login / password solution wanted, so i must use cookie and
    session.

    If i use this http://www.foo.com and http://www.fii.com the session_id()
    will be different in the 2 sites so i can't recognize the user.

    If i use CNAME with a common domain 'stuff'
    http://foo.stuff.com, http://foo.stuff.com the session_id() will different
    but i can use this:
    setcookie ("TestCookie ", $value_md5,time ()+3600, "/", ".stuff.com ", 0); the
    cookie will be accessible from the 2 sites, not the $_SESSION but i can put
    my vars in database using TestCookie as id.

    BUT, my boss want not an alias url, he wants http://www.foo.com, so i think
    it's impossible. Am I right ?

    PS: pointing http://www.foo.com to http://.foo.stuff.com doesn't change the
    url so it doesn't resolve anything
    PS: using only remote ip to identify someone is impossible because of proxy,
    intranet etc...


  • Dirk Engels

    #2
    Re: Sharing a shopping cart between 2 sites...

    CanardWC wrote:
    [color=blue]
    > Hello,
    >
    > Just a little problem. I want to share a shopping cart between 2 php sites
    > for example foo and fii.
    > There'is no login / password solution wanted, so i must use cookie and
    > session.
    >
    > If i use this http://www.foo.com and http://www.fii.com the session_id()
    > will be different in the 2 sites so i can't recognize the user.
    >
    > If i use CNAME with a common domain 'stuff'
    > http://foo.stuff.com, http://foo.stuff.com the session_id() will
    > different but i can use this:
    > setcookie ("TestCookie ", $value_md5,time ()+3600, "/", ".stuff.com ", 0);
    > the
    > cookie will be accessible from the 2 sites, not the $_SESSION but i can
    > put my vars in database using TestCookie as id.
    >
    > BUT, my boss want not an alias url, he wants http://www.foo.com, so i
    > think it's impossible. Am I right ?
    >
    > PS: pointing http://www.foo.com to http://.foo.stuff.com doesn't change
    > the url so it doesn't resolve anything
    > PS: using only remote ip to identify someone is impossible because of
    > proxy, intranet etc...[/color]

    Hi,

    I think you will need a custom session handler. If you save your sessions in
    the db, you can recall the session from multiple sites. See for more
    informatie the article at www.phpbuilder.com

    --
    BOFH Excuse #230:

    Lusers learning curve appears to be fractal

    Comment

    Working...