9three Posted March 8, 2009 Share Posted March 8, 2009 <?php session::Start(); //session::setSession('member', 1); //session::setSession('USER_AGENT', $_SERVER['HTTP_USER_AGENT']); //session::Authenticate(index); ?> <html> <head> <title></title> </head> <body> <?php foreach ($_SESSION as $field => $level) { if (isset($field) && $level == 1) echo 'Tester Session'; elseif (isset($field) && $level == 2) echo 'Agent session'; else echo 'No session detected'; } ?> </body> </html> I grayed out the area so I could get my else statement to echo out 'No session detected', but it's not working. I tried doing some of the follow //Attempt 1 elseif (!isset($field)) echo 'No session detected'; //Attemp 2, I also tried $field == '' || $value == '' elseif ($field == NULL || $level == NULL) echo ''No session detected'; Anyone know what I'm doing wrong? Link to comment https://forums.phpfreaks.com/topic/148426-solved-not-detecting-my-session-correctly/ Share on other sites More sharing options...
9three Posted March 8, 2009 Author Share Posted March 8, 2009 Figured it out. Since I'm not setting a session, only starting it, it doesn't display it. Link to comment https://forums.phpfreaks.com/topic/148426-solved-not-detecting-my-session-correctly/#findComment-779258 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.