Created
September 19, 2013 19:28
-
-
Save gabrieljmj/6628624 to your computer and use it in GitHub Desktop.
A helper to work with sessions in php
This file contains 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 | |
class Session{ | |
public static function add( $name, $value ){ | |
$_SESSION[ $name ] = $value; | |
} | |
public static function del( $name ){ | |
unset( $_SESSION[ $name ] ); | |
} | |
public static function get( $name ){ | |
return $_SESSION[ $name ]; | |
} | |
public static function exists( $name ){ | |
return isset( $_SESSION[ $name ] ); | |
} | |
public static function startAll(){ | |
session_start(); | |
} | |
public static function destroyAll(){ | |
session_destroy(); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment