Newbie session registration question
| From: | Paul Fernandez | Date: | Tue, 27 Jun 2000 15:02:31 +0000 |
| Subject: | Newbie session registration question | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-22495@lists.php.net to get a copy of this message | ||
Hi there,
I was using sessions to store username, password & database info for
oracle logins.
Nothing in my scripts changed, yet the session variables were no longer
being passed
in. We stopped/restarted the apache server with no results.
a standard html passes in username, password & database via POST to this
php file:
<?
session_start();
session_register('username');
session_register('password');
session_register('db');
$connection = OCILogon($username,$password,$db);
if ($connection == false){
echo "login failed.<br>";
exit;
}
if (isset($username)){
echo "username successfully set";
}
//bla bla bla
OCILogoff($connection);
?>
The script will echo "username successfully set." There is a link to a
new page with
this session script:
<?
session_start();
session_register('username');
session_register('password');
session_register('db');
echo "username=$username<br>pass=$password<br>db=$db";
$connection = OCILogon($username,$password,$db);
if ($connection == false){
echo "login failed.<br>";
echo "debug info: <br>
username=$username<br>password=$password<br>db=$db";
echo 'now destroying session.';
session_destroy();
exit;
}
?>
I get
username=
pass=
db=
...in other words, the session variables act undefined. Why would this
happen
abruptly? I did not change any code in this part of the php file for
weeks.
Any help is appreciated!
Paul