Skip to content

CodeIgniter Redirect to Current Page URL After Logout ?

Last updated on January 17, 2018

In CodeIgniter you can get current page URL using CodeIgniter URL helper function current_url().

Now you knew how to get current page URL, then append the current page URL to logout URL, here is the code

 echo anchor('auth/logout','logout/'.base64_encode(current_url()));

now in your logout method should be something like this :

public function logout($url){
    redirect(base64_decode($url));
}

Post By:Arjun
Website: arjunphp.com

0 0 votes
Article Rating
Subscribe
Notify of
guest

4 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments