Last active
August 29, 2015 14:03
-
-
Save mucahit/6429d7b4c3efdd04ff3b to your computer and use it in GitHub Desktop.
Session class with 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 sess | |
{ | |
public static function create($array){ | |
foreach ($array as $key => $value) { | |
#create session | |
$_SESSION[$key] = $value; | |
} | |
} | |
public static function delete(){ | |
#delete session | |
session_destroy(); | |
} | |
public static function session($name){ | |
if(@$_SESSION[$name]){ | |
return $_SESSION[$name]; | |
}else{ | |
return false; | |
} | |
} | |
} | |
?> |
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 | |
$array = array( | |
'name' => 'riza', | |
'sifre' => 'kel123', | |
'id' => 3 | |
); | |
sess::create($array); //oluşturduk | |
sess::session('name'); //gösterdik | |
//sess::delete(); sildik | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ay cok ttlsn grcktn 🍺