473,378 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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...
Jul 17 '05 #1
1 2113
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Don Grover | last post by:
USing ASP, MSSql on W2k3 I am worried of accumulated old cart product selections from expired browser windows or other unforseen events. I am holding selected productID's & quantities & userID...
5
by: VM | last post by:
I'm interested in creating a simple shopping cart in C#. Are there sites that show you, step by step, how to create a simple cart? The sites I've found only show you pre-made shopping carts that...
1
by: Adil Akram | last post by:
I have created a site shopping cart in ASP.net. I am using ASP session object's SessionID on non SSL connection to track session. While adding products to cart DB I insert product and SessionID...
1
by: jecha | last post by:
I'm implementing a shopping cart but am having a problem in checking out a person who has added item in his/her shopping busket.The code for the checkout.php script is given below <?...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.