i'm trying to add arrowchat, an tchat box from arrowchat.com And these file is just using php without using twig in my website and i don't know how to do for integrate this file with my session variable from twig.
This is what i need to do for integrate these file:
First, open the arrowchat/includes/integration.php file. This file must be customized to fit your specific website.
get_user_id() Function
The first and most important function to setup is the get_user_id() function. This function will simply return the user's ID or NULL if no user is logged in. The two most common ways to setup this function are by cookie and session.
Using a Session example:
function get_user_id()
{
$userid = NULL;
if (!empty($_SESSION['userid']))
{
$userid = $_SESSION['userid'];
}
return $userid;
}
My problem is: It's not working and i think it's because $_SESSION['userid'] doesn't exist.
How can i do for take the user id from my session without using twig? I'm using FOSUserBundle for making the session when i connect to my website
Thanks all :)