clarkwinkelmann Yes, it is for ArrowChat. The exact code of the PHP function that I'm using is:
function get_user_id()
{
global $db;
$userid = NULL;
if (!empty($_COOKIE['flarum_remember']))
{
$result = $db->execute("
SELECT user_id
FROM " . TABLE_PREFIX . "access_tokens
WHERE token = '" . $db->escape_string($_COOKIE['flarum_remember']) . "'
");
if ($row = $db->fetch_array($result))
{
if (!empty($row['user_id']))
{
$userid = $row['user_id'];
}
}
}
return $userid;
}
Flarum_remember works just by searching the database, but only if the user selected the 'Remember Me' option. I need it to work in all situations.
I plan on tapping into the flarum_session cookie instead.