Skip to content

Commit

Permalink
logout non funzionante e lezione 10 slides
Browse files Browse the repository at this point in the history
  • Loading branch information
martiele committed Apr 15, 2020
1 parent 34a48b6 commit 8eb97ad
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Lezione 10/File e upload.gslides
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"url": "https://docs.google.com/open?id=1k_UzhUg_Lc6pdbsLST9ZiHiIyUmOeGkUchyCptXgeIc", "doc_id": "1k_UzhUg_Lc6pdbsLST9ZiHiIyUmOeGkUchyCptXgeIc", "email": "[email protected]"}
5 changes: 5 additions & 0 deletions Lezione 9/login_cookies/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

$check_access = "Marco" . md5("12345");

/*
var_dump($_COOKIE);
die();
*/

if(isset($_COOKIE["username"]) && isset($_COOKIE["access"]) ){
$user = $_COOKIE["username"];
Expand Down Expand Up @@ -47,6 +51,7 @@

if( (isset($_POST["ricordami"])) &&
($_POST["ricordami"]=="1") ){

setcookie("username", $nome, time() + 2592000 );
setcookie("access", $access, time() + 2592000 );
}
Expand Down
9 changes: 9 additions & 0 deletions Lezione 9/login_cookies/Scripts/PHP/Logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
include("SessionManager.php");

session_destroy();
//unset($_SESSION["login"]);

//Distruggere i cookies
setcookie("username", "", time() +36000 );
setcookie("access", "", time() +36000 );

//session_write_close();


header('location:../../Login.php');

?>
4 changes: 4 additions & 0 deletions Lezione 9/login_cookies/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
header("location:Login.php");
exit();
?>

0 comments on commit 8eb97ad

Please sign in to comment.