RE: Session configuration

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

 



The error just means you are printing something out before you call
session_start();

you just need to call session_start() *before* you print anything out to the
page, so it's best off called at the top/start of your php page.

-----Original Message-----
From: Voodoo [mailto:cronopio@terra.com.br]
Sent: 10 November 2003 5:09
To: php-windows@lists.php.net
Subject:  Session configuration


I'm using php 4.3.0 under an IIS server, and I'm having some trouble on
starting a session. I guess it's a configuration problem. Tried to edit the
php.ini file, and found this line:

; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.

I don't know what changes I got to do, as Windows user, to get it working
properly. Is this the problem?

The session.save_path is allright, I can see the session file being created
every time I use the session_start() method, but I receive this error
message:

Warning: session_start() [function.session-start]: Cannot send session
cookie - headers already sent by (output started at c:\(blah)\teste.php:9)
in c:\(blah)\teste.php on line 12

Warning: session_start() [function.session-start]: Cannot send session cache
limiter - headers already sent (output started at c:\(blah)\teste.php:9) in
c:\(blah)\teste.php on line 12

The script I'm using to test it is the session example script from the
documentation at php.net:

session_start();
if (isset($HTTP_SESSION_VARS['count'])) {
   $HTTP_SESSION_VARS['count']++;
}else {
   $HTTP_SESSION_VARS['count'] = 0;
}
echo $HTTP_SESSION_VARS['count']."<br>";
?>
<a href="teste.php">Acrescentar</a>

Can somebody help me?

Cheers,

Voodoo

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


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
**********************************************************************

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux