My Ride
Started: Friday 24th May 2013 4:33pm
Distance: 17.46km
Duration: 00:39:15
Rest Time: 00:06:05
Climb: 124m
Max Speed: 51.48kmph
Average Speed: 26.68kmphInstagrams
-
Recent Posts
Recent Comments
- Arie on Tag Time: CakePHP Tag Plugin
- Paul on Sign Me Up A CakePHP User Registration Plugin
- Paul on Sign Me Up A CakePHP User Registration Plugin
- Watch The Big Bang Theory season 6 episode 13 on On My Tv: With Trakt.tv
- veloura et bellagenix on Ultimate Guestbook Tutorial: How to build a Guestbook with a honeypot, error checking, IP banning, pagination, e-mail notification and smilies with PHP and mySQL
Archives
- February 2013
- December 2012
- September 2012
- July 2012
- January 2012
- September 2011
- August 2011
- February 2011
- January 2011
- November 2010
- October 2010
- August 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
Categories
Meta
Stay Out CakePHP Component
June 27, 2010,
1,117 views
I have recently been developing a new website which has found me in the position of writing a lot of session handling code. I came across the concept of logged out all sessions across multiple instances, and out came this CakePHP session flushing component stay out.
Stay out works by storing a timestamp in the users session and cross referencing that in the database. The component works by storing a unique SHA1′d string at the time of a user logout action (which should be called manually). When other user sessions of the same user are active and previously a log out has been called, that logged in user is then forced to be logged out.
You can find the project status over at: http://github.com/voidet/stay_out
Usage:
First thing that needs to be done is to include it in your app/controllers/components folder as stay_out.php. Next include it in your list of components, noting that it should come after Auth:
var $components = array('StayOut');
The only thing that you really need to handle is when to execute the logout function. This should be done before you log the user out for example:
function logout() {
$this->StayOut->setLogout();
$this->StayOut->logout(); // or $this->Auth->logout();
}
There is another method called StayOut::logout() available to you, however this is just a helpful tool to flush out a user and all cookies associated with them. This is used internally in the event that an older session attempts to use a logged out session, however can also be called as a red alert flush all info helper.






One Trackback
[...] This post was mentioned on Twitter by Richard S, DevMoose. DevMoose said: Stay Out CakePHP Component: I have recently been developing a new website which has found me in the position of wr… http://bit.ly/9Np8yS [...]