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

Sharing a shopping cart between 2 sites...

P: n/a
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...
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
CanardWC wrote:
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...


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

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.