Date: 10/10/00
- Next message: Bernd Duesmann: "[phplib] phplib and forum"
- Previous message: Magnus Jonsson: "[phplib] Has anybody had any success with Sybase/PHP on Windows?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello, I need some help with login form using php3, phplib and IE5.5
When I go to my login form, I enter my name and password. The page posts to
itself, queries the database to see if the password and login are valid. It
finds the valid password and login and, thus, starts up a session. I set
the value of $r to be time(void) and call my session header file:
class Temp_File_Container extends CT_File
{
// path to folder where temp session files are stored
var $file_path = "/tmp/";
}
class sid extends Session
{
var $classname = "sid";
var $cookiename = ""; //defaults to classname
var $allowcache = "no";
var $allowcache_expires = "30";
var $magic = "fun";
var $mode = "cookie";
var $fallback_mode = "get";
var $lifetime = 0;
var $that_class = "Temp_File_Container";
var $gc_probability = 50;
}
page_open (array ("sess" => "sid"));
// check session expiration limit, limit in seconds
$limit=1800;
$time_lapsed=(time(void)-$r);
echo $time_lapsed;
if ($time_lapsed>$limit) {
header("Location:
/members/logout.php?goback=/members/login.php&sid=".$sess->id."&r=".time(voi
d));
}
I then register my variables.
$sess->register ("__username");
etc.
My problem is that, for some reason, a cookie is apparently, not set. So,
when the session header is processing, I get sent to the following bit of
code in session.inc (lines 386-410)
function release_token(){
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $HTTP_HOST, $HTTPS;
if ( isset($this->fallback_mode)
&& ( "get" == $this->fallback_mode )
&& ( "cookie" == $this->mode )
&& ( ! isset($HTTP_COOKIE_VARS[$this->name]) ) ) {
if ( isset($HTTP_GET_VARS[$this->name]) ) {
$this->mode = $this->fallback_mode;
} else {
echo "Status: 302 Moved Temporarily";
//header("Status: 302 Moved Temporarily");
$this->get_id($sid); //sets cookie
$this->mode = $this->fallback_mode;
if( isset($HTTPS) && $HTTPS == 'on' ){
## You will need to fix suexec as well, if you use Apache and CGI PHP
$PROTOCOL='https';
} else {
$PROTOCOL='http';
}
echo "Location: ". $PROTOCOL. "://".$HTTP_HOST.$this->self_url();
//header("Location: ". $PROTOCOL.
"://".$HTTP_HOST.$this->self_url());
exit;
}
}
}
Something about the 302 status and the page redirect means that I loose my
username and password form variables. I get redirected to the page I'm on
and am told that my username/password are incorrect. (I know it's not just
a typo as taking out the session header include causes the test for those
items to be true.) If I immediately go back to the login form and re-enter
the info, everything is okay and I get logged in with a valid session ID.
This only seems to happen in IE.
Any hints? I've inherited these forms from a co-worker and don't know much
about phplib and login. (I use phplib and sessions on a site that don't
require login.) I don't understand why the cookie isn't getting set. This
happens with any IE5 user...all of them can't have their cookies disabled
and I know I don't!
thanks,
Beth
___________________________________________________________
miri <email protected> miri <email protected>
http://miriland.com/ http://www.stigma.com
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Bernd Duesmann: "[phplib] phplib and forum"
- Previous message: Magnus Jonsson: "[phplib] Has anybody had any success with Sybase/PHP on Windows?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

