Re: $_SESSION is not working
- From: danielTI@xxxxxxxxx (Daniel Castro)
- Date: 24 Apr 2005 19:50:56 -0700
"Ken Robinson" <kenrbnsn@xxxxxxxxx> wrote in message news:<1114177605.028006.62050@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>...
> Daniel Castro wrote (in part):
> > The code is :
> > session_start();
> > // *** Validate request to log in to this site.
> > $FF_LoginAction = $_SERVER['PHP_SELF'];
> > if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING']!="")
> > $FF_LoginAction .= "?".$_SERVER['QUERY_STRING'];
> > if (isset($_POST['login'])) {
> > $FF_valUsername=$_POST['login'];
> > $FF_valPassword=$_POST['senha'];
> > $FF_fldUserAuthorization="";
> > $FF_redirectLoginSuccess="principal.php";
> > $FF_redirectLoginFailed="erro_login.php";
> > $FF_rsUser_Source="SELECT usu_login, usu_senha ";
> > if ($FF_fldUserAuthorization != "") $FF_rsUser_Source .= "," .
> > $FF_fldUserAuthorization;
> > $FF_rsUser_Source .= " FROM usuario WHERE usu_login='" .
> > $FF_valUsername . "' AND usu_senha='" . $FF_valPassword . "'";
> > $FF_rsUser=pg_query($wmed,$FF_rsUser_Source) or
> > die(pg_result_error());
> > $row_FF_rsUser = pg_fetch_assoc($FF_rsUser);
> > if(pg_num_rows($FF_rsUser) > 0) {
> > // username and password match - this is a valid user
> > $_SESSION['$MM_Username']=$FF_valUsername;
> > // echo $_SESSION['$MM_Username'];
> > // session_register("MM_Username");
> > if ($FF_fldUserAuthorization != "") {
> >
> $_SESSION['$MM_UserAuthorization']=$row_FF_rsUser[$FF_fldUserAuthorization];
> > } else {
> > $_SESSION['$MM_UserAuthorization']="";
> > }
> >
> > What happens:
> >
> > The user logs in the system but in the next page the MM_Username
> > session variable is unset.
> > Please somebody help me !
>
> Can we see the code on the next page?
>
> A few hints:
> Don't put a "$" in the $_SESSION index. Use something like
> $_SESSION['MM_Username'].
> Make sure you have the session_start() statement at the start of each
> script.
> Check to see what's in the $_SESSION array at the start of your script:
> After the session_start(), add the lines:
>
> echo '<pre>';
> print_r($_SESSION);
> echo '</pre>';
>
> Ken
Hi Ken,
Thank you for the help.
I did as you told, but nothing happened...
Te outpu for print_r($_SESSION) is :
Array
(
)
The webserver is using port number 2139...
Any other information?
Thanx
.
- Follow-Ups:
- Re: $_SESSION is not working
- From: Chris White
- Re: $_SESSION is not working
- References:
- $_SESSION is not working
- From: Daniel Castro
- Re: $_SESSION is not working
- From: Ken Robinson
- $_SESSION is not working
- Prev by Date: Re: $_SESSION is not working
- Next by Date: session....need advice
- Previous by thread: Re: $_SESSION is not working
- Next by thread: Re: $_SESSION is not working
- Index(es):
Relevant Pages
|