<?php 

class SessionClass{
	
	public function setSessionWithArray($sessionval){ // SESSIONVALUES ARE IN ARRAY WITH KEY VALUE PAIR
	  try{
		  if(is_array($sessionval)){
			  foreach($sessionval as $session_key => $session_val){
				  if(!empty($session_key)){
					  $_SESSION[$session_key] = $session_val;
				  }
			  }
		  }
	  }catch(exception $e){
		  return $e;
	  }
	}
	
	public function setSingleSession($key, $value){
	  $_SESSION[$key] = $value;	
	}
	
	public function getSessionId(){
		return session_id();
	}
	
	public function getSessionValueByKey($key){
		if(!empty($_SESSION[$key])){
			return $_SESSION[$key];
		}else{
			return '';
		}
	}
	
	public function getAllSessionValue(){
	  return $_SESSION;
	}
}