What is the best way to make a logout link? I want to destroy all my sessions and do a redirect back to the login page but I'm not sure the best way to do this. Right now I have the link leading to a admin/logout.php but I feel like it would be a bad thing to show the user my folder structure. Here's my code it's pretty straight forward:
session_start();
session_destroy();
echo "<script type=\"text/javascript\">window.location.href='../login.php';</script>";
So would it be best to do something in javascript or ajax?