Sign out Page Encrypted Messenger PHP

Sign out Page

Encrypted Messenger PHP

session_unset

The session_unset() function frees all session variables currently registered.

session_destroy

session_destroy() destroys all of the data associated with the current session.
It does not unset any of the global variables associated with the session, or unset the session cookie.
To use the session variables again, session_start() has to be called.

setcookie

The setcookie() function defines a cookie to be sent along with the rest of the HTTP headers.
A cookie is often used to identify a user.
A cookie is a small file that the server embeds on the user’s computer.
Each time the same computer requests a page with a browser, it will send the cookie too.
With PHP, you can both create and retrieve cookie values.
The name of the cookie is automatically assigned to a variable of the same name.
For example, if a cookie was sent with the name “user”, a variable is automatically created called $user, containing the cookie value.
Note: The setcookie() function must appear BEFORE thetag.
Note: The value of the cookie is automatically URLencoded when sending the cookie, and automatically decoded when received (to prevent URLencoding, use setrawcookie() instead)

Create a file named index.php


<?php
function secured_error () { die("Secured By Omid Bahrami"); }
set_error_handler("secured_error");

require '../secured/secured-database.php';
require '../secured/secured-encryption.php';

session_start();

$xux=gns_hash_fix($_SESSION["secured"]);
$xtx=gns_encode(7);
gns_save_cookie("","","",$xux,$xtx);

session_unset();
session_destroy();

setcookie( XFIRSTNX , "" , 7 , "/" , XDOMAINX , true , true );
setcookie( XSECONDNX , "" , 7 , "/" , XDOMAINX , true , true );
setcookie( XTHIRDNX , "" , 7 , "/" , XDOMAINX , true , true );

header("location:../sign-in/");
?>

Full structure is available at Encrypted Messenger PHP