Skip to content

Commit

Permalink
Create logout.php for terminate session #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Deshan555 committed Nov 13, 2022
1 parent 26b7e2a commit fe73f8f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,9 @@

</div>

<button class="logout-btn">LogOut</button>
<form method="GET" action="logout.php">
<button class="logout-btn">LogOut</button>
</form>

</div>

Expand Down Expand Up @@ -401,8 +403,6 @@

</section>



</body>

</html>
13 changes: 13 additions & 0 deletions logout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

session_start();

session_unset();

session_destroy();

header("location: login.php");

exit;

?>

0 comments on commit fe73f8f

Please sign in to comment.