Skip to content

Instantly share code, notes, and snippets.

@rahuldottech
Last active August 22, 2018 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahuldottech/c9dc9195af5c48ec25af63459fb9f6d9 to your computer and use it in GitHub Desktop.
Save rahuldottech/c9dc9195af5c48ec25af63459fb9f6d9 to your computer and use it in GitHub Desktop.
Usage examples for secSesh
<?php
require 'secsesh.php';
session_start();
if(/*credentials check out*/){
\secSesh\start();
}
if(\secSesh\check()){
// do stuff after successful login
header( 'Location: somePage.php' );
}
<?php
require 'secsesh.php';
session_start();
\secSesh\end();
if(!\secSesh\check()){
// redirect to another page after successful logout
header( 'Location: somePage.php' );
}
<?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