By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,751 Members | 1,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,751 IT Pros & Developers. It's quick & easy.

session checking

P: 14
I am using session checking on each page to ensure the user had logged on. When they do the following code is executed:
[PHP]
function startSession($lg_name){
session_start();
$_SESSION['author'] = $lg_name;
}[/PHP]

at the start of each page the following code is then executed:
[PHP]
session_start();
if (!isset($_SESSION['author'])){
$result = "invalid";
}else{
$result = "valid";
//$_SESSION['position'] = $_SERVER['REQUEST_URI'];
}
return $result;
[/PHP]

The problem i have is that i can just enter the URL of a page in IE and it lets me in. I thought it might be because of the session_start being called, but the same happens without this. Any ideas?
Apr 26 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.