Learn how to use PHP sessions



captain sensible Since Dec 18, 2015 3 Posts

Nice article , one way i use sessions is with login attempts; every new surfer gets a session if they go to https://www.ginbrookes.co.uk/adminLogin and then try to login. Because a lot of programs are around that automate going through passwords lists and such i give them 4 goes then they get brushed off. I check session variables this way isnull( $f3->get('SESSION.count ')) ; because i'm using a framework it equates to $SESSION['count']; so you check if session is set for a particular session variable . $SESSION['count']; might be null but $SESSION['user']; might be set. One thing that could be gone into futher is the relationship between a cookie and a session. A session is assigned a pseudo-random, secret ID that is usually stored in the user's browser using a cookie, for example SESSID=abcdef123456789 etc