4

We are trying to accomplishing a shopping cart experience using force.com sites where home page and products page is customized in customer portal.

When they click on a product and say add to cart cookies will store that data and when they click on cart symbol page will redirect to force.com site page

Question

Can cookies be carried to force.com site page as previous page was from different domain?

1
  • 1
    No, they won't. You'll have to pass them through the URL, create custom cookies or use local storage, etc.
    – sfdcfox
    Feb 12, 2016 at 22:12

1 Answer 1

0

If you only need the cookies for the active site: Have a look at document.cookie . It contains semicolon-separated key=value pairs. Or you can use cookies in Apex.

Note : that due to security concerns you can't access cookies from a different domain. When you run something from the console, it's the equivalent of it running directly from the page, you'll have to go to each website separately.

Due to this, only options you have left is create a dummy object in SF and store all the data in them based on UserId or SessionId or using any unique value. And clear this object's record on regular basis. Because in your current requirment Cookeis will not help you.

I am Not sure if it helps you but you can try Session Cache

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .