On my shared server I frequently have trouble saving session variables.
If I run the script over and over again, eventually the variables register.

I thought I would try looping until they save properly, like this...

while (!isset($_SESSION['uid']))
{
$_SESSION['uid'] = $uid;      
$_SESSION['pwd'] = $pwd; } endwhile;

But it doesn't work. Anybody know why?

    do
    {
    $_SESSION['uid'] = $uid;      
    $_SESSION['pwd'] = $pwd; } while (!isset($_SESSION['uid']))

      There's absolutely no reason to do that. You're most likely not seeing the change due to your browser caching the page.

        even if u set the php session variable, u cant make sure client browser registered it..this code absolutely makes no sense.

          anoopmail;10963384 wrote:

          u cant make sure client browser registered it

          Er... what do you mean by "registered it" ? The browser doesn't do anything with session data - that's all stored on the server.

            AFAIK a session key is handed over to the browser and the browser attach it on each request so that server identify which session key it is talking about.

              Write a Reply...