473,804 Members | 2,271 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2128
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
1632
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 & sessionID in a sql table from a shopping cart. I allow user to clear their cart from a button and also automatically clear their cart on user logon. Also on checkout I clear their cart.
5
20524
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 you can reuse. Those are good but I'd like to learn how to create one from scratch. Thanks. VM
1
3232
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 in table. All products and cart status pages are on non SSL connection. On checkout to get secure user information I shifted connection to SSL but when shifting to SSL, the SessionID changed (As is this is default behavior of IIS to prevent...
1
7301
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 <? require_once('functions.inc.php'); session_start(); do_html_header("Checkout"); $cart = $_SESSION; if($cart&&array_count_values($cart)) { display_cart($cart,false,0); display_checkout_form($HTTP_POST_VARS);
0
9714
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10347
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10090
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9173
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7635
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.