https://www.informit.com/articles/article.aspx?p=22681&seqNum=3
right now, i can tell you that your code is not concurrency-safe (meaning multiple-inserts at once):
-
there's only 1 proper way to do it, and sadly - you will never find it anywhere in any laravel or php tutorials and it's because this issue is related to data modelling and databasesthat's how it works
-
It takes time() and adds config('session.lifetime') to it
-
Then you get a cookie that expires at time() + config('session.lifetime')
-
There's very little point in making the user extend the session, it's something you make user think about and users know fuck all about techy shit
-
Instead, you can use what google does and does it really good set a cookie for 2 years