This is shopping online page that a user can add what products he wants in his shopping cart, but when the user clicks on view shopping cart i need to pass the variable $_SESSION['cart_Name'] to shoppingcart.php page, to retrieve the info from the database, i tried this code :
in onlineshop.php:
<a href="shoppingcart.php?si=<?php echo session_id; ?>"><img src="cartt.png" alt="ٍShopping Cart" style="width:40px;height:40px"><br/>Shopping Cart</a>
in shoppingcart.php:
session_start();
session_id($_GET['si']);
but it gave me this error:
Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\xampp\tmp) in Unknown on line 0
A session id doesn't disappear between two pages, i wonder why you load a session from a $_GET variable.
Moreover, by modifying your URL and playing with ?si, people can steal another person's session, it's a security trouble.
if on page A.php you have
session_start();
$_SESSION["cartname"] = "foo";
<a href="B.php">click Me </a>
in your page B.php this code :
session_start();
echo $_SESSION["cartname"];
will display : foo
Best regards