Skip to content

Instantly share code, notes, and snippets.

@woganmay
Created February 12, 2017 13:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woganmay/a77c1826af966a936f817151fe510bf4 to your computer and use it in GitHub Desktop.
Save woganmay/a77c1826af966a936f817151fe510bf4 to your computer and use it in GitHub Desktop.
Set the flarum_remember cookie from a GET parameter
@donli1210
Copy link

Hello,

I tried to integrate Flarum into my existing website. I'm using the API Authentication

POST /api/token HTTP/1.1

{
"identification": "Toby",
"password": "pass7word"
}

to get the flarum token and use

setcookie("flarum_remember", $token, time() + (10 365 24 60 60), "/");

to set the flarum cookie. It is working in the begining. But after several hours, the user is automatically logout althrough the "flarum_remember" cookie is still there.

Please advice. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment