Skip to content
This repository has been archived by the owner on Sep 13, 2018. It is now read-only.

Commit

Permalink
Started and finished drop/session.php
Browse files Browse the repository at this point in the history
  • Loading branch information
pksunkara committed Apr 11, 2011
1 parent fa64d2b commit 41e1cd7
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion drop/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,45 @@ class Session extends Object {
* Constructor.
*/
function __construct() {

session_start();
}

/**
* Method to set session variable
*/
function set($key, $val) {
$_SESSION[$key] = $val;
}

/**
* Method to get session variable
*/
function get($key) {
return $_SESSION[$key];
}

/**
* Method to delete session variable
*/
function delete($key) {
unset($_SESSION[$key]);
}

/**
* Method to check session variable
*/
function check($key) {
if(array_key_exists($key,$_SESSION))
return true;
else
return false;
}

/**
* Destructor
*/
function __destruct() {
session_unset();
}

}
Expand Down

0 comments on commit 41e1cd7

Please sign in to comment.