eZ Community » Forums » Setup & design » Webshop basket filled on session start

Webshop basket filled on session start

Webshop basket filled on session start

Friday 14 October 2011 1:04:38 pm - 2 replies

I have been scratching my head over a strange issue for some days now, maybe someone could shed some light!

I'm implementing a simple webshop which shows the basket contents inside the pagelayout (this code part is not inside a cache-block) When I open a new browser session, the basket fetch function contains the following:

object(eZBasket)#214 (5) {
["PersistentDataDirty"]=>  bool(false)
["ID"]=>  string(1) "6"
["SessionID"]=>  string(0) ""
["ProductCollectionID"]=>  string(2) "12"
["OrderID"]=>  string(1) "0"

The session id is empty. This means the same basket is shown for ALL anonymous users that start using the site. When someone puts something in the basket, it will stay in the product collection forever, and everybody will see it until someone finishes the order process.

However, when I browse to the /shop/basket view, a different basket and session are instantiated, and everything starts working as expected.

Any suggestions on this puzzle?

Modified on Friday 14 October 2011 1:07:21 pm by Sander van den Akker

Friday 14 October 2011 6:49:41 pm

Hello Sander,

What version of eZ Publish are you using (some times this matters)?

You do realize the eZ Publish shop has (quite a while ago in 4.5) been deprecated and will be removed from future versions of eZ Publish. I think it's still ok to use the deprecated shop knowing these limitations because there are plans to move the shop to it's own extension for it's continued development and improvement. I just like to inform folks of this ... knowing is half the battle happy.gif Emoticon

Re: http://issues.ez.no/18285



I searched the issues.ez.no tracker but could not seem to find any similar issues to yours.

I'm sorry I don't know the answer to your question offhand.

I'm hoping someone else can step in and provide a few suggestions or pointers.




Saturday 15 October 2011 5:52:19 pm

I finally tracked down what was causing this. Since the new 4.5 session management implementation (which uses the default php session manager), sessions are not started for anonymous users by default. I had to put this line in my .htaccess to fix this:

php_flag session.auto_start on

Modified on Saturday 15 October 2011 5:53:26 pm by Sander van den Akker


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from