Jump to content

Token Authentication - Cookie question


Go to solution Solved by ginerjm,

Recommended Posts

Hi

 

I am wanting to create a login for a portal I have created and want to use access tokens.

 

These tokens expire after 60 minutes when they need to refresh (refresh token will also be sent to the client).

 

How do I achieve this, when the authentication request succeeds (e.g. login with username and password) do I set a client side cookie that has the access_token and refresh_token values along with a cookie expiry?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/307158-token-authentication-cookie-question/
Share on other sites

  • Solution

???

 

You simply create a cookie FROM THE SERVER in the script that authenticates the access. Then wherever you need to check for a proper signon, in each script you simply check for the existence of that cookie. You can also store (perhaps) a value or two in the cookie if you need to know something about the user. DO NOT STORE any sensitive info in the cookie

Edited by ginerjm
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.