Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

session_save_path question

Status
Not open for further replies.

spicymango

Programmer
May 25, 2008
119
CA
Hi,

My following logic used to work for login, till some one added

session_save_path("/home/users/web/b154/ywh.sntrader/cgi-bin/tmp");


Now i can not login, why is that?

Code:
 session_save_path("/home/users/web/b154/ywh.sntrader/cgi-bin/tmp");
session_start();

$password="xyzi123";
$username="sobi";


if (($password == $_POST['password']) and ($username == $_POST['username']))
{
	$_SESSION['admlogin'] = "OK"; 
?>
<script language="JavaScript" type="text/javascript">


location.href="adm_search.php"
</script>

<?php
}

else
{

?>
<script language="JavaScript" type="text/javascript">
location.href="adm_login.php?loginflag=No"
</script>
<?php
}
?
 
why on earth are you using javascript to redirect people? use header() instead. or better still incorporate the logic of the login system at the page level.

as to your actual question, the most likely reasons why the addition of this line would cause problems are if either that location is not writable and readable OR if it does not exist. In either case if you had error display and error reporting turned on you would be told the answer.

here is an old article on php debugging, which you might find useful. You might also look at sleipnir214's contribution: faq434-2999
 
I don't know. PHP will probably tell you if you switch on all error reporting. Even on a production server, you do not want to ignore errors. You just want to hide them from users and potential hackers.

My guess is that the errors will tell you that the web server user has insufficient rights on that directory.


+++ Despite being wrong in every important aspect, that is a very good analogy +++
Hex (in Darwin's Watch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top