Jump to content

Archived

This topic is now archived and is closed to further replies.

creativkook

Error with Session()

Recommended Posts

Ok, so I didn't design this code.  I'm just trying to fix an error on it, and the guy that worked here before me used this open source code.  Here are the errors I get if I click on any of the pages to edit through the database.

Warning: session_start(): open(C:\PHP\sessiondata\sess_7cb495eef5c712685f50cbe5087669cb, O_RDWR) failed: Permission denied (13) in c:\web\cc\groups\scripts\sb_login.php on line 30

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:\web\cc\groups\scripts\sb_login.php:30) in c:\web\cc\groups\scripts\sb_login.php on line 30

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\web\cc\groups\scripts\sb_login.php:30) in c:\web\cc\groups\scripts\sb_login.php on line 30


The area of code it's referring to:

[code]function logged_in ( $redirect_to_login, $redirect_to_setup ) {
// Check if the user is logged in and has a session.
//
// Session data is stored in a client-side cookie.
// Login flag is stored in the session cookie.

// Support for PHP >= 4.1.0
// Check if the user has a client-side cookie.
if ( isset( $_COOKIE['my_id'] ) ) {
$my_id = $_COOKIE['my_id'];

// Turn off URL SIDs.
// ini_set( 'session.use_trans_sid', '0' );

// Init the session.
session_set_cookie_params(time()+60*60*24*5);
session_id($my_id);
session_start ();

// Check if they're logged in.
if ( isset( $_SESSION['logged_in'] ) && $_SESSION['logged_in'] == 'yes' ) {
if ( $_SESSION['site_path'] === dirname($_SERVER['PHP_SELF']) ) {
return ( true );
}
}
}[/code]

These errors also came up at the bottom of the window.


Warning: Unknown(): open(C:\PHP\sessiondata\sess_7cb495eef5c712685f50cbe5087669cb, 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 (C:\PHP\sessiondata) in Unknown on line 0

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.