Symfony Framework has this built in and it's a real treat to use. <a href="http://symfony.com/doc/2.0/book/security.html#impersonating-a-user" rel="nofollow">http://symfony.com/doc/2.0/book/security.html#impersonating-...</a>