headers and session
| From: | Alessandro Rosa | Date: | Mon, 06 Jun 2005 16:00:27 +0000 |
| Subject: | headers and session | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-216496@lists.php.net to get a copy of this message | ||
> Does config.inc.php have any whitespace following the closing ?> tag, or
> does it output any HTML? That could be your culprit.
>
> What happens if you do your $_SESSION setting *before* the require, but
> directly after the initial header() call?
He knew that header may give problems with whitespaces, but this was not the
case.
With regard to your secondo question, it works !
that is, the code now looks like:
<?php
session_start();
////////////////////////////////////////////////////////////
$_SESSION['session_psw'] = $_POST['txtPassword'];
$_SESSION['session_user'] = $_POST['txtIdUtente'];
////////////////////////////////////////////////////////////
header( "Cache-control: private" );
require_once("config.inc.php");
$PHPcmd = $GLOBALS['gestionale_path_name']."test/2.php" ;
header( "Location: ".$PHPcmd );
?>
But could someone explain me why ?