Max Buvry wrote:
> 
> Marek Kilimajer wrote:
> >
> > You miss closing }
> >
> 
> Thanks, but that's a copy-paste error and that's not my problem really.
> 
> mb


Solved : my solution for information (before test with url !)

<?php
if ( !isset($_SESSION['count']) )
   $_SESSION['count']= 1;
else
   $_SESSION['count']++;

if ( $_SESSION['count'] > 5 )
{
   $cook_param= session_get_cookie_params();
   $life_time= $cook_param['lifetime'];
   $path= $cook_param['path'];
   setcookie(session_name(),"",$life_time,$path);
   echo "<HTML><TITLE>Session and cookie</TITLE><BODY>";
   echo "session change<BR>";
   echo "hello ! : it's ".$_SESSION['count']."times and the last<BR>";
   $_SESSION= array();    //session_unset();
   session_destroy();
   echo "</BODY></HTML>";
}
else
{
   echo "<HTML><TITLE>Session and cookie</TITLE><BODY>";
   $cpt = $_SESSION['count'];
   echo "hello ! : it's ".$_SESSION['count']."times";
   echo "<br><br> Information :<br>";
   echo "name = ".session_name()."<br>";
   echo "id = ".session_id()."<br>";
   echo "</BODY></HTML>";
}
?>

The problem was setcookie execution after the header sending.

mb

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to