Re: $_SESSION is not working



"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
.



Relevant Pages

  • Launch at login
    ... like it to open automatically when the user logs in. ... causes the application to open but the login script to hang at this ... some other scripting technique. ... Prev by Date: ...
    (microsoft.public.windows.server.sbs)
  • check administration point
    ... administration point? ... i want this 'check' every time a user logs on ... is there a script available? ... Prev by Date: ...
    (microsoft.public.office.setup)
  • Logoff user!
    ... How can I check whether the user logs off or not using visual basic ... script?, and at the same time how can I stop an infinite loop, if the ... Prev by Date: ...
    (microsoft.public.windows.server.scripting)
  • Re: Weird script issues
    ... I also have the script as a logon script, so each time a user logs in it will ... I even get the error when a user logs in, so .UserName should not be ... It would fail at the line aUserName = Split ...
    (microsoft.public.scripting.vbscript)
  • Re: Ideas for second account and logging the actions? - Interestin
    ... user logs on, it can only write the event in event viewer. ... I have prepaired a small script that uses CDO ... admin for the boss would be OK? ... He does not want to use this account often. ...
    (microsoft.public.windows.server.active_directory)