...

View Full Version : session variables



Aymen++
04-15-2004, 11:40 AM
i used this function:
session_start();
and i had these warnings:
Warning: Cannot send session cache limiter - headers already sent (output started at c:\program files\apache group\apache\htdocs\test\index.php:8) in c:\program files\apache group\apache\htdocs\test\index.php on line 38

Warning: open(/tmp\sess_2f20ae55ca19e33486cb9c946e0b2c97, O_RDWR) failed: m (2) in c:\program files\apache group\apache\htdocs\test\index.php on line 38

Warning: open(/tmp\sess_2f20ae55ca19e33486cb9c946e0b2c97, O_RDWR) failed: m (2) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

what is the problem? and what is the solution?

Spookster
04-15-2004, 12:37 PM
You cannot output anything at all to the browser before calling the session_start() function. So make sure you have don't have any extra lines or spaces that are being outputted to the browser before that line.

firepages
04-15-2004, 01:08 PM
you need to edit your php.ini to set the session.save_path directive to a directory that exists , say 'c:/windows/temp' or whatever , just make sure it exists

zigo86
04-15-2004, 02:42 PM
Best advice: If your using php sessions on a page, the VERY FIRST TWO LINES should look like this:


<?
session_start();
// Rest of code

raf
04-15-2004, 03:40 PM
Best advice: If your using php sessions on a page, the VERY FIRST TWO LINES should look like this:


<?
session_start();
// Rest of code

No. Your very first line should be


<?php

firepages
04-15-2004, 03:46 PM
the output errors are probably due to the warnings created from the session write error , fix the session.save_path first , the other errors may then (or may not) go away.

Spookster
04-16-2004, 12:25 AM
you need to edit your php.ini to set the session.save_path directive to a directory that exists , say 'c:/windows/temp' or whatever , just make sure it exists

Wow how did I miss those other warnings they had posted? lol That's what I get for trying to answer a question at 6:30 in the morning. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum