Add <? session_start(); ?> At the top of each page, before anything else is done.
Jay -----Original Message----- From: Adam Douglas [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 01, 2002 3:15 PM To: PHP-General (mailing list) (E-mail) Subject: [PHP] Session Initially Does Work Hi. I've run into a problem with my PHP session. I'm running PHP 4.1.0 on OpenBSD v3.0 using .HTACCESS and mod_mysql. I have a PHP file that is referenced every time content is requested on the web site (this file also sets/restores the session). This PHP file includes [include()] the requested content within. When my session is created I register 6 variables. The problem comes into play when you want to access one of the 6 registered variables on the initial page (after the user logs in). For some reason the registered variables are not recognized. I'm accessing the register variables using $_SESSION[variable_name]. I've also assigned values to these variables. The funny thing about the whole issue is if you reload/refresh the page or load something else after the initial page everything works fine. I require this to work initially because if someone comes in directly using a link certain content will render a error message because the registered variable is not present for some reason. Oh and yes the cookie to set the session is being put on the client's machine properly and at the initial page. Am I doing something wrong? Any suggestions would be greatly appreciated! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php