Re: Session start problem
| From: | Mathieu Dumoulin | Date: | Mon, 07 Jul 2003 17:11:33 +0000 |
| Subject: | Re: Session start problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154207@lists.php.net to get a copy of this message | ||
Problem was that the TMP dir was full and we couldn'T write down the session
file... Seems this jams the server completly. Be aware that if anything like
that happen to you that you have to check fro the TMP files that might be
overflooding your partition.
"Mathieu Dumoulin" <mdumoulin@groupimage.com> wrote in message
news:20030707152500.32302.qmail@pb1.pair.com...
> We are using php 4.0.6 here on a dev server and we are getting a weird
> session_start() problem.
>
> After setting up the login on another page, if we register any of our
three
> required varaibles to go on, the session_start() will simply crash and
loop
> endlessly. We have tested everything:
>
> - setting values after registering, before registering, not registering at
> all and as soon as we register a variable it loops endlessly when we start
> the session. Needless to say that we NEED to fix that or else we have a
> wonderfull system with no login nor sessions...
>
> here is the code:
>
> [[[[[[[[[[[[[[[LOGIN.PHP]]]]]]]]]]]]]]]]]]]
>
> <?
> session_start();
> include('../includes/open.php');
>
> function verifypass($login, $password)
> {
> global $sql, $result;
> $req="SELECT * FROM giuser WHERE login= '" . $login . "' AND
> password
> ='" . md5($password) ."' ";
> $result=mysql_query($req, $sql);
>
> if(mysql_num_rows($result) < 1) // le resultat est unique
> {
> return 'Erreur: mot de passe invalide';
> }
> return '';
> }
>
> if($submit == '' || $login == '' || $password == '' || ($moo =
> verifypass($login, $password))!='')
> {
>
> echo '<html><head><title>Gestion des projets</title><meta
> http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <link href="../css/giprojects.css" rel="stylesheet"
> type="text/css"></head>
> <body leftmargin="0" topmargin="0" marginwidth="0"
> marginheight="0"
> class="giprojects">';
> echo '<FORM name="loginform" method="post"
> action="login.php?submit=1">
> <table width="100%" height="100%" border="0"
> cellpadding="5"
> cellspacing="0" class="txt11px">
> <tr> <td><p align="center"><img
> src="../images/logo.gif"><br><br><br><br>Nom
> d\'usager :
> <INPUT name="login" type="text" id="projet25"
> size="18" maxlength="15"
> >';
> if($submit!='' && $login=='') echo ' *';
> echo '<br>Mot de passe : <INPUT name="password"
> type="password"
id="login"
> size="20" maxlength="15">';
> if($submit!='' && $password=='') echo ' *';
> echo '<br><br><a href="#"
> onClick="document.loginform.submit(); return
> true;">Entrer</a></p></td>
> </tr></table><div
> align="center"></div></body></html>';
> }
> else
> {
> $req="SELECT * FROM giuser WHERE login= '" . $login . "' AND
> password
> ='" . md5($password) ."'";
> $result=mysql_query($req, $sql);
>
> if(mysql_num_rows($result) < 1) // le resultat est unique
> {
> include( 'login.php?e=1');
> }
> else
> {
> $row = mysql_fetch_array($result);
>
> session_register("session_user");
> session_register("session_niveauusager");
> session_register("session_nomusager");
> $session_user = $login;
> $session_nomusager = $row[nom];
> $session_niveauusager=$row[level];
>
> echo '<HTML><HEAD><TITLE>GI Projects</TITLE><META
> http-equiv="refresh"
> content="5; URL=todo.php?user=' . $login
> .'"></HEAD><BODY>';
> $req="SELECT nom FROM person WHERE id = ". $row[personid] ;
> $result = mysql_query($req, $sql);
> $row = mysql_fetch_array($result);
> echo '<center><h3>Bienvenu '. $row[nom] .
> '!</h3></center>';
> echo '<center>[niveau d\'access: '. $session_niveauusager .
> ']'; }
> }
>
> include('../includes/close.php');
> ?>
>
> [[[[[[[[[[[[[[[[[[[[[[TODO.PHP]]]]]]]]]]]]]]]]]]]] (File that we get
> redirected to after loging in that loops edlessly)
>
> <?php
> session_start(); //<--------------- JAMS HERE
> exit("AHHHHHHHH");
> //include('secur.php'); ?>
> <?php include('../includes/open.php'); ?>
>
> <HTML>
> <HEAD>
> <?php //include('../includes/helpers.php');
> </HEAD>
> </HTML>
>
>