Question and answer is powered by AnsPress.io
I am developing a web page using Codeigniter and I create a login and logout system in my Codeigniter website, all work is done. But I want to set the redirect page go to the previous page after logout in Codeigniter. How can I do it? Help me, please.
If you want to redirect the previous page after login or log out from your codeigniter web page, you need to use this code.
<?php $_SERVER['HTTP_REFERER'] ?>
Put this in your redirect URL. For example:
<?php redirect($_SERVER['HTTP_REFERER']); ?>