The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Regenerating FCSID for user on logout. New fcsid not persistent.

EricBEricB Member
I have looked through the V2.0 Foxycart API and found a few ways to generate a new fcsid, but I am always returned the original on new page loads.

Using JS:
original fcsid: 60bnaoaa7ajj66pdaqe5c0ono7

On page load I can call: FC.session.reset();
And I get a new fcsid for the foxycart store subdomain: scs09jq714n7j0cs17jbbs9e76
I can check the session info in a browser console and it works:
FC.session.get() = fcsid=scs09jq714n7j0cs17jbbs9e76;
In the console, I can make a request to the cart and get the right data back.
But, in my JS file, any requests made after calling FC.session.reset() still using the old fcsid.

If I comment out FC.session.reset() in my JS file and refresh the page, I get the old fcsid back (fcsid=60bnaoaa7ajj66pdaqe5c0ono7).

I have also tried using a PHP request to reset the cart. When I make a request /cart?empty=reset I get back a new cart with a new fcsid.
On future page loads, I still have the old fcsid.

Am I missing a step? Do I need to make another request to FC after I get a new fcsid?
  • fc_adamfc_adam FoxyCart Team

    Thanks for posting your summary there, sorry to hear you're having trouble resetting the session ID.

    Calling FC.session.reset(); should indeed correctly update the session ID that the page is using - both immediately and for subsequent page reloads. I just completed a quick test on my own test page using Chrome and that's working as expected.

    Is your page online somewhere that we could take a look? To confirm - you haven't hard-coded the session ID anywhere on the page have you?
  • pm sent.
Sign In or Register to comment.