I've modified a cart in a learning experience, and I'm having some 'session' issues.
bio: A user comes to products page and clicks 'add to cart', can keep shopping or checkout. 'Checkout' has an include (session.php) which has the following snippet:
function GetCartId()
{
if(isset($COOKIE["cartId"]))
{
return $COOKIE["cartId"];
}
else
{
session_start();
setcookie("cartId", session_id(), time() + ((3600 24) 30));
return session_id();
}
}
To make it short, when a user clicks 'place order', it sends a confirmation email, and unsets the cookie, and redirects the user to the index page.
It unsets the cookie, but the session remains if the user goes back to the cart.
Seesion unset and session_destroy(); give me an error: "wrong number of parameters..." Why? How do I fix? thanks.