working on a bought login script and this line I can't figure out the meaning PHP Code: <?php ob_start(); ?> <?php include_once('classes/translate.class.php'); ?> <?php if (!isset($_SESSION)) session_start(); ?> <---- this logic is not making sense to me. It says if $_SESSION is not set then start session. My question is if $_SESSION is not set why would you want to start a session.. Shouldn't I start/ continue a session only if that is set.. Other wise any one would be able to log into my protected pages isn't it?
http://stackoverflow.com/questions/6249707/check-if-php-session-has-already-started this will help you
I am not sure i understand you correctly... but I think sessions are created for each user individually. So if (!isset($_SESSION)) session_start(); // means if there is no session for this user, then start a session for this particular user. There are things like session hijacking , but I know next to nothing about them. hth
<?php ob_start(); session_start(); ?> <?php include_once('classes/translate.class.php'); ?> Bu şekilde dener misin?
You are right. even if you start session `session_start()` then the global $_SESSION will still be empty, unless any value is assigned to it.