Page 1 of 1

Sessions!!! the session.save_path=?

Posted: Tue Apr 22, 2003 8:00 am
by gasoga
I don't know what im doin wrong i am registering variables and startin the session but it won't wirte it to the session temp dir! I have changeed the

session.save_path but nothin seems to work ! I am running it on Windows !
The error i am gettin is the following:

Bad LoginPHP Warning: session_start() [function.session-start]: open(/tmp\sess_65312e54bf624e4e1aec49682b88b8ca, O_RDWR) failed: No such file or directory (2) in F:\Support WebSite\public_html\html\login.php on line 62 PHP Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent in F:\Support WebSite\public_html\html\login.php on line 62 PHP Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent in F:\Support WebSite\public_html\html\login.php on line 62 PHP Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 PHP Warning: Unknown(): open(/tmp\sess_65312e54bf624e4e1aec49682b88b8ca, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 PHP 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

The code i am usin is:

Code: Select all

<?php
session_start();
		session_register('UserName');
		session_register('FirstName');
		session_register('Position');
		session_register('in');
		$in = "0";
		
		$db = odbc_connect($dbsource, $dbuser, $dbpass) or die(odbc_errormsg);

		
		$sql = "select * from $dbtable where UserName = '$UserName' AND Password = '$Password'";

		$result = odbc_exec($db, $sql) or die(mysql_error());

		//get the number of rows in the result set
		$num = odbc_fetch_into($result,$results);

		$name = odbc_fetch_into($result,$Results);

		$UserName = $name[0];
		$FirstName = $name[1];
		$position = $name[6];

		if($num != 0 && $name[6]=="admin")
		{
			header("Location: DeftCallLog.php");
			exit;
		}
		else if($num != 0 && $name[6]=="Customer")
		{
			header("Location: CustCallLog.php");
			exit;
		}
		else
		{
			echo("Bad Login");
			exit;
		}

?>
Thanx for any help!!!

Permissions

Posted: Tue Apr 22, 2003 8:29 am
by oQEDo
Have you read this post ?
viewtopic.php?t=6521


First thing I would check is:
Does the session.save_path folder have the correct permissions set in order for the anonymous IUSER account to write to it :?:

Posted: Tue Apr 22, 2003 9:32 am
by gasoga
Any idea how to find this folder and set the permissions??

Posted: Tue Apr 22, 2003 9:36 am
by twigletmac
It doesn't look like you've changed the location of the session directory - it is looking for /tmp which doesn't exist. Try changing it to something like C:\PHP\sessinfo\, create that directory and then try using sessions.

Mac

Posted: Tue Apr 22, 2003 10:03 am
by gasoga
Hey thanx
tried that even rebooted the server but unfortunatly im still gettin the same error!!!
Aggghhhh!! Its so frustrating! It doesn't seem to recognise any changes im making!

Posted: Tue Apr 22, 2003 10:16 am
by DeGauss
So you changed the session save file path in php.ini to be something like c:\php\session?

Did you create the directory? PHP won't try and make the directory for you, it has to be there to put the files in.

Posted: Tue Apr 22, 2003 10:28 am
by gasoga
Yep created the directory! I even put it on the drive where my server is on but it just gives me the same erroR ! its like its not even recognisin any of the changes i make to the file!

Permissions

Posted: Tue Apr 22, 2003 10:36 am
by oQEDo
In windows explorer if you right click the folder where you are saving the sessions and click properties. Click the security tab and then the permissions button. Make sure that the IUSER account has write permissions to this folder.
If this doesn't work go into IIS manages and make the folder a virtual web directory.

Posted: Tue Apr 22, 2003 12:28 pm
by twigletmac
Put

Code: Select all

<?php phpinfo(); ?>
into a file, check what it thinks the session folder is and also where the php.ini file is stored. It may be that you have more than one php.ini and you're editing the wrong one - do a search of your system to check.

Mac

Posted: Wed Apr 23, 2003 11:16 am
by gasoga
Hey mac!!
Thanx a mill you were right i was editing the wrong one!!
Got the prob fixed!!!
Cheers!! :D