I have been trying to save a variable using PHP sessions.

What I find is that while most of the time the variable content is restored
and available on the subsequent pages, however there are times that the
variable seems to be there but the contents are not.  If I hit the browser
refresh a couple of times, it will then work.
What am I doing wrong??

Here is the code fragment where the variable is set and kept in session:

at the beginning:
<?PHP
// routine to allow login to the system and authenticate that login
session_start();

:
  $adminkey = $row["keychain"];
  print("Keychain: $adminkey<br><hr>");
  session_register(adminkey);

==
then in the page that needs to get the $admin key contents:

<?php
// restore the session
session_start();

if (isset($adminkey)) {
 print ("Adminkey is: $adminkey :");
 } else {
 print ("Adminkey is not set");
 }
?


==
many times the value is presented. Sometimes it is a null string. Sometimes
it takes a few refreshes before it will display anything other than blank.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to