RE: Cookies and sent headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



sessions and cookies either need to be set at the beginning of the page, or you can look into the ob_start(), ob_flush() functions to use output buffering


bastien

----------------------------------------
> To: php-general@xxxxxxxxxxxxx
> Date: Sat, 18 Aug 2007 11:25:54 +0200
> From: otto.wyss@xxxxxxxxxx
> Subject:  Cookies and sent headers
> 
> If built a simple login page and store any information within 
> $_SESSION's. Yet I'd like to move these into cookies but I always get an 
> error about sent headers. Is there a way to circumvent this problem 
> without changing too much in the page?
> 
> The setting of the cookies happens just at the end of the page.
> 
>    if (!$errortext and $Anmelden) {
>      if (!empty($Permanent)) {
>        $expires = time()+ 365 * 86400;  // 365 days
>        setcookie ("l.Lastname", $_SESSION['l_Lastname'], $expires);
>        setcookie ("l.Firstname", $_SESSION['l_Firstname'], $expires);
>        setcookie ("l.Email1", $_SESSION['l_Email1'], $expires);
>        setcookie ("l.Email2", $_SESSION['l_Email2'], $expires);
>      }
>      echo "";
>      exit;
>    }
> 
> O. Wyss
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

_________________________________________________________________
Explore the seven wonders of the world
http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux