sessions working? not working?

[email protected] ("Clifford Shuker")
Newsgroups php.general
Message-ID <C5D7B310D5AE44B0A0B0700BD741193C@LucyHP>
Hi List,

 

Hi have the following (below) session code at the top of each page..  The
'print_r' (development feature only) confirms that on one particular page I
do log out as the session var = (). but, on testing that page via the URL I
still get to see the page and all its contents - session var() -..  the page
has the following  'session_start, DOCTYPE Info then <html><head>containing
meta info & title</head><body>containing style/tables/content/</body></html>
// end of page.  I have copied the same page without the html content (i.e.
a blank page) and I get to fully log out.. when this page is tested in the
URL my warning comes up 'you need to login to see this page' which is what I
want but, I've tried numerous avenues to reconcile my problem to no avail..
I'm a novice so any help would be appreciated..   

 

<?php

session_start();

error_reporting (E_ALL ^ E_NOTICE);

$userid = $_SESSION['userid'];

$username = $_SESSION['username'];

print_r($_SESSION);

?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.