如何将facebook长途访问令牌从服务器发送到浏览器?

I obtain long live access token with PHP SDK on server and want to send it back to browser to make api calls on behalf of user from browser instead of server. I have googled a lot but all I can find is lot of answered question on how to send token from browser to server or "you can send token from server to browser any way you want" which is not helping a lot.

Even fb developers page ends up saying to simply send it back t client in any secure way.

However it doesnt seem to be that trivial to me because JS SDK will use access token that is stored in cookie named fbsr_appId. Does that mean that I have to simply set a cookie

$this->load->helper('cookie');
$fbCookie = array(
        'name'   => 'fbsr_appId',
        'value'  => /*long live access token fetched from db*/,
        'expire' => /*expire time of fbs long live access token*/,
        'domain' => 'www.my-site-name.com',
        'path'   => '/'
);
set_cookie($fbCookie);

I am using CodeIgniter but I would appreciate a lot any help explaining general idea of this action?