Cookie or not Cookie ...

General ShopSite user discussion

Cookie or not Cookie ...

Postby nicolas » Mon Sep 24, 2007 4:07 pm

Hello,

I am trying to pass the cart from one session to another one.
Why ? Because when the customer is calling I want my customer service rep to get his cart automatically

I am storing the value of the shopsite cookie ss_cart_0001141555 in a database.
The value is stored properly (getcookie + insert into db)

1) But I can't set the cookie back to another session properly for some reasons.

In php I used different things :

setcookie('ss_cart_0001141555',$mycart,time() + 3600, '/', 'domain.com', 0);
setcookie('ss_cart_0001141555',rawurlencode($mycart),time() + 3600, '/', 'domain.com', 0);
setrawcookie('ss_cart_0001141555',rawurlencode($mycart),time() + 3600, '/', 'domain.com', 0);

But the value get all kind of %20 ...

2) I get 2 cookies with the same name

I get 2 'ss_cart_0001141555' cookies (one from the cart and mine) The only difference when I look at the cookies in firefox is host : domain.com and domain : domain.com

Any clues ?

Thank You
nicolas
 
Posts: 12
Joined: Mon Sep 24, 2007 4:02 pm

Postby loren_d_c » Mon Sep 24, 2007 4:21 pm

#2 is probably because you are specifying your domain name when setting the cookie. ShopSite doesn't specify a domain when setting the cookie, so the browser automatically sets a domain for it (whatever domain it is that is setting the cookie). This is probably the difference in your two cookies.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby nicolas » Thu Sep 27, 2007 10:19 am

Thank You

I think this is good for #2

Now I have still this issue :

The data are in the database to recreate the cookie.
I tried 2 things :

1) Creation of the cookie with javascript
The cookie is created and I am able to see my mini cart with the right information.
But When I checkout. The cart is empty.


2) Creation of the cookie with php
The cookie is created but I am not able to see my mini cart.
The cart is empty.

Any ideas ?

Thank You

Nicolas
nicolas
 
Posts: 12
Joined: Mon Sep 24, 2007 4:02 pm

Postby loren_d_c » Thu Sep 27, 2007 12:00 pm

I think you are under the impression that the mini-cart cookie controls the content of the cart, which is incorrect. The 'mini-cart' cookie is just an abbreviated representation of what the shopper has already placed into their cart. So you can't force products into the cart or see the shopper's cart just by setting a mini-cart cookie.

The cookie that identifies the shopper with their actual shopping cart file on the server is generally called 'sbid', and it contains a unique random number that identifies them. So if you could set a sbid cookie on your browser with the same value as the shopper's then you could see what products they have in their cart, if that is what you are trying to accomplish. But how you are going to get the sbid value from the customer without getting them to look through their browser cookies (which would probably be a confusing process for many shoppers) is another question.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere

Postby nicolas » Thu Sep 27, 2007 2:02 pm

Thank You

The sbid cookie is set to /cgi-domain/sb/
How can I read the cookie then from my website with php or javascript anywhere on the website ?

Nicolas
nicolas
 
Posts: 12
Joined: Mon Sep 24, 2007 4:02 pm


Return to User Forum

Who is online

Users browsing this forum: No registered users and 144 guests