Re: How do I use sessions if cookies are turned off in the browser?
| From: | Matt M. | Date: | Fri, 20 Aug 2004 14:22:49 +0000 |
| Subject: | Re: 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-194331@lists.php.net to get a copy of this message | ||
> ===== 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>';
> ?>
are you sure $sid is getting set?
this if(!$_SESSION['count']) might skip it.