You know something...
I have been an online retailer and I have been toying with this for years!
But one thing I've found is that the people who completely turn off cookies are people who dont understand how their browser or even your website works! - What's more we find they are the uptight "problem" customers most of the time anyway!
It is true that a php session reuires a cookie, but I wouldn;t worry, if cookies are completely turned off, php will add PHPSESSID as a variable in the query string.
The PHPSESSID is stored on your server.
<? session_start();
if ( !isset( $_SESSION["cart"] ) && !empty( $_SESSION["cart"] ) ) {
$_SESSION["cart"] = "THIS IS TESTING CONTENT";
}
- THIS WILL NOT WORK WITH COOKIES OFF - BECAUSE PHP CANNOT TRANSMIT IT'S "PHPSESSID" VARIABLE:
header("location:index.php");
?>
You will have to add an html link on the page, php will automatically add the PHPSESSID to the link for you.
Then on index.php do this:
<?
echo $_SESSION['cart'];
?>
There is very few instances this won't work.
There is never a time when a php session wont work.