0

I have a login form, where you can login, but it doesnt work properly. I suspect its due to JQuery Mobile. When I logout, I go to the main login page, but my URL remains logout.php (a file that destroys the session, then uses header(location) to redirect user to login) and I cant login anymore, because my page is stuck. When I refresh this gets solved. But when I try to login, the URL remains login.php. When I refresh now, I get redirected back to login.php. A refresh doesnt work here. How can I fix this? Everything used to work, but now it doesnt.

<head>
<meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Hondensectie</title>
    <link rel="stylesheet" href="themes/themerollertest.min.css" />
    <link rel="stylesheet" href="themes/jquery.mobile.icons.min.css" />
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css" />
    <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
</head>

above you can see the head

 <?php   
 session_start();  
 session_destroy();  
 header("location: login.php"); 
 ?>  

above you see logout.php

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
jshufs
  • 1

1 Answers1

0
<?php   
session_start();  
$des = session_destroy();  
if($des) {
    header("Location: login.php"); 
}
?>