Changes to SocialController.php to add $this->Session->read('last_viewed_page') if the user would like to redirect back to their last page.