There is a session which holds a data gathered from facebook. I'm trying to cache that data with Sessions. But session returns NULL in function. and yes i wrote the session_start() of course.
Here is the functions
session_start();
function startsessions(){
    $_SESSION["fbdata"] = array();
}
function getAccount($id){
    GLOBAL $facebook;
    echo $id; 
    echo gettype($_SESSION["fbdata"]["page$id"]);
    if(isset($_SESSION["fbdata"]["page$id"])){
        $result = $_SESSION["fbdata"]["page$id"];
        echo "session mode";
    }else{
        $result = $facebook->api('/'.$id);
        $result["pageimg"] = "http://graph.facebook.com/$id/picture/?width=100&height=100";
        $_SESSION["fbdata"]["page$id"] = $result; 
        echo $_SESSION["fbdata"]["page$id"];
        echo "livemode";
    }
    return $result;
}
 
    