[PHP] sessions working? not working?
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 htmlheadcontaining meta info title/headbodycontaining 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); ?
Re: [PHP] sessions working? not working?
On Aug 12, 2013, at 4:27 AM, Clifford Shuker clifford.shu...@ntlworld.com wrote: 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 htmlheadcontaining meta info title/headbodycontaining 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); ? Ok, but when are you populating the SESSION's? Such as: $_SESSION['userid'] = $userid; Also, have a look at this: http://sperling.com/php/authorization/log-on.php It might help. tedd ___ tedd sperling tedd.sperl...@gmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions working/not
Hey - -- - Would anyone be so kind as to un-stick my brain? I can't get sessions to work on my development machine (localhost). They work fine on my testing server (an internal IP). Development: W2K, Testing Server W2K Server, both using IIS 5, PHP 5.2. The php.ini SESSION settings are the same on both machines. Seems to me I made this choice at some point, but now my feeble brain can't bring it up. bueller Anyone? Anyone? /bueller Ken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php