homepage Welcome to WebmasterWorld Guest from 54.205.254.108
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Failed to write session data
tomhumf




msg:3911316
 8:48 pm on May 11, 2009 (gmt 0)

Hi,

I'm getting the error below for a couple of my sites when adding items to the cart.

The problem seems to be related between the two sites. If I load one site it works, then load another site it gives the erro. If I clear the cookies using the browser the second site works, but the first one gives error unless I clear cookies again.

It's all very confusing. I thought it must be the configuration of php.ini at first, but as the error doesnt occur all the time this seems unlikely.

Any ideas what might be going on?

Thanks


Warning: session_start() [function.session-start]: open(/tmp/sess_ca4bb68ad69507adc6c02c89bff93333, O_RDWR) failed: Permission denied (13) in /home/panther/public_html/basket/cart-process.php on line 1

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/panther/public_html/basket/cart-process.php:1) in /home/panther/public_html/basket/cart-process.php on line 1

Warning: Cannot modify header information - headers already sent by (output started at /home/panther/public_html/basket/cart-process.php:1) in /home/panther/public_html/basket/cart-process.php on line 44

Warning: Unknown: open(/tmp/sess_ca4bb68ad69507adc6c02c89bff93333, O_RDWR) failed: Permission denied (13) in Unknown on line 0

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

 

tomhumf




msg:3911379
 10:08 pm on May 11, 2009 (gmt 0)

I've just realised this is probably happening because the session id the same for each site? If I exit a site but don't close the browser, the second site gives the error. But if I exit the site and close the browser, then open the second site I don't get the error.

I'm not destroying the session if someone leaves the page, but from what i've just read that isn't simple. I'm also not naming sessions which I guess would make using two sites after each other work better. I think I need to do some more reading on using sessions...

enigma1




msg:3911794
 1:09 pm on May 12, 2009 (gmt 0)

the warning means you need to setup a directory where sessions can be written to (/tmp/ should been a directory at the root of the space your host assigned to you).

Search your files for a function called session_save_path. You should be able to specify where the sessions should be stored (outside the web space). However you should store sessions in the database as it is much easier to manage.

tomhumf




msg:3911818
 2:01 pm on May 12, 2009 (gmt 0)

Hi, Thanks. I think the sessions are being stored in the tmp folder above my web folder though. That is the path set in php_info.

As I said, it works fine if I clear the browser's cookies so I think its a problem with not naming sessions whilst using two sites without closing the browser.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved