You are here: Re: headers and session « PHP « IT news, forums, messages
Re: headers and session

Posted by Matthew Weier O'Phinney on 06/06/05 18:52

* "Alessandro Rosa" <zandor_zz@yahoo.it>:
> Hi to all,
>
> I got a problem while storing session variables.
>
> <?php
> session_start();
> header( "Cache-control: private" );
>
> require_once("config.inc.php");
>
> ////////////////////////////////////////////////////////////
> $_SESSION['session_psw'] = $_POST['txtPassword'];
> $_SESSION['session_user'] = $_POST['txtIdUtente'];
>
> ////////////////////////////////////////////////////////////
>
> $PHPcmd = $GLOBALS['gestionale_path_name']."test/2.php" ;
>
> header( "Location: ".$PHPcmd );
>
> ?>
>
> After the call to header(...), the values of session variables are lost.

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?

--
Matthew Weier O'Phinney | WEBSITES:
Webmaster and IT Specialist | http://www.garden.org
National Gardening Association | http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:matthew@garden.org | http://vermontbotanical.org

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация