Last active
August 22, 2018 13:47
-
-
Save rahuldottech/c9dc9195af5c48ec25af63459fb9f6d9 to your computer and use it in GitHub Desktop.
Usage examples for secSesh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'secsesh.php'; | |
session_start(); | |
if(/*credentials check out*/){ | |
\secSesh\start(); | |
} | |
if(\secSesh\check()){ | |
// do stuff after successful login | |
header( 'Location: somePage.php' ); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'secsesh.php'; | |
session_start(); | |
\secSesh\end(); | |
if(!\secSesh\check()){ | |
// redirect to another page after successful logout | |
header( 'Location: somePage.php' ); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
This is how all your pages should be structured | |
*/ | |
require 'secsesh.php'; | |
session_start(); | |
if(\secSesh\check()){ | |
// user is logged in! do stuff | |
} else { | |
// user is not logged in! do some other stuff | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment