RE: [PHP] How do I use sessions if cookies are turned off in the browser?
| From: | Don | Date: | Fri, 20 Aug 2004 13:20:40 +0000 |
| Subject: | RE: [PHP] How do I use sessions if cookies are turned off in the browser? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194324@lists.php.net to get a copy of this message | ||
Dazed and confused. I've tried the suggestions thus far (I believe) and no
luck. Below is the current code. For somw reason, when I disable cookies
in my browser:
1. The session ID is NOT being passed in the URL
2. The session ID changes everytime I click on the link; probably because it
creates a new session evertime.
Suggestions?
===== Start of Code =====
<?php
session_start();
header("Cache-control: private"); //IE 6 Fix
if(!$_SESSION['count']){
$_SESSION['count'] = 1;
$sid = session_id();
echo '<p>Session is: ' . $sid . '</p>';
} else {
$_SESSION['count']++;
}
echo '<p>You have visited <? echo $_SESSION[\'count\']; ?> pages so
far!</p>';
echo '<p><a href="test.php?sid="' . $sid . '>Increment Your
Counter!</a></p>';
?>
====== End of Code ======