Laravel 6 set a cookie that lasts forever at the start of an authenticated session.
I want to store a cookie that has a value that is equal to the app's version number, and do the following:
when a user is authenticated, check to see if the cookie exists
if the cookie does not exist, create it
if the cookie exists, check the value and compare it against a DB value
if the DB value is greater than the cookie value, it means the app has updated, then show an update notification that links to the latest doc.
Keep the cookie value the same until the user has acknowledged the notification, then update the cookie to be equal to the DB value.
I can handle the logic for steps 3 and 4, but what I am having a hard time figuring out is how check for the cookie when a user logs in, and how to create it to last forever if the cookie doesn't already exist.
@Snapey So a version number column on the user table that stores the version number they last used, and compares it to the current version number, and if they are the same, then no update, if the current version number is > user_version it means there has been an update.
with cookies the user is going to see that update notice on every device, and if they delete their cookies or have a new machine, then they are back at version 1 and get every notice...