Is there a way to capture session_start errors

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Is there a way to capture session_start errors

Post by yacahuma »

I just got an error where there was not space in the hd to write a session. Is there anyway to capture this error so that my application dont die horribly?

Thank you
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: Is there a way to capture session_start errors

Post by Zoxive »

yacahuma wrote:I just got an error where there was not space in the hd to write a session. Is there anyway to capture this error so that my application dont die horribly?

Thank you
Well if your Site uses sessions, then what's the point if there is no space to save that session on the server? You lose all that functionality.
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: Is there a way to capture session_start errors

Post by yacahuma »

is important for the login. That way I can show a "Site is unavailable" message. Or something like that. I found something in php.net about using

Code: Select all

 
function session_started(){
    if(isset($_SESSION)){ return true; }else{ return false; }
}
 
did not have chance to try it since the fix the problem
Post Reply