-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcookie1.php
More file actions
29 lines (27 loc) · 777 Bytes
/
cookie1.php
File metadata and controls
29 lines (27 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
if(isset($_POST['submit']))
{
if(isset($_POST['remember']))
{
setcookie("username",$_POST['txtname'],time()+ 3600);
setcookie("password",$_POST['txtpass'],time()+ 3600);
echo "Cookies set successfully";
}
else
{
setcookie("username","");
setcookie("password","");
echo "Cookies Not set";
}
}
if(isset($_POST['delete']))
{
setcookie("username","",time()-3600);
setcookie("password","",time()-3600);
echo "Cookies deleted successfully";
}
?>
<p><a href="cookie.php"> Go to Login Page </a> </p> <br><br>
<form method="POST" action="">
<input type="submit" name="delete" value="Delete Cookie">
</form>