I'm trying to make a logout function on codeigniter 4, and I'm realizing there is different things from v3
public function logout(){
session_start();
session_destroy();
return redirect()->to("/");
}
this is not redirecting me to my virtualhost / route its redirecting to localhost:8080/
My Answer:
>to('http://localhost:8080')->with('success', 'Logged out successfully');_ }
Rate this post
5 of 5 based on 4506 votesComments