having to find an alternative to sessions
Hi All,
First of all I would like to say I have enjoyed using laravel a lot while I have been rebuilding my website I have been able to remove so much code from my previous design but I must say that using sessions has been such a pain I am leaving my features that rely on sessions till last as I think I will need to use a global variable or store a ton more data in my database to do what I needed with sessions which is a shame really as I see tons and tons of people with the same issue of the session data being reset on page load and after trying everything possible with changing paths and updating composer and doing a fresh install of laravel 5.4 I am very disappointed about how complicated it has been to simply store a string in a session.
e.g (Controller - [Function that returns my thread view]) if(session($threadID) != 'seen') { \DB::table('forum_threads')->where('id', $threadID)->increment('views', 1); session([$threadID => 'seen']); }
or
if(!\Session::has($threadID)) { \DB::table('forum_threads')->where('id', $threadID)->increment('views', 1); \Session::put($threadID, 'seen'); }
kind of a rant so apologies but it has been very frustrating to do something so very very simple with so many problems, even resorting to PHP's original session_start() | $_SESSION has not been productive as the data is all reset (lifetime is 2 hours fyi in session.php) so for now sessions are going to be left well alone as they just don't want to play ball with my application I really hope that having such heavy usage on my database on every page load is not going to slow down the site too much... ( I know its a lost cause )
Please or to participate in this conversation.