Strange behaviour of Laravel Sessions and How I overcome it.

1440300377000 php laravel

by Start Bootstrap


I recently met a strange behaviour from laravel where i am getting logged out in certain minutes, though i have set the expiration of the session
for a very long time.

Few of my office mates (Mr.Manoj) and other suffered the same issue recently.

To handle it, I tried to follow the bad practise of setting the user id in local storage and getting it each time.

Then i planned to overcome in some legal hacks,

After few close analysis of browser i noted that laravel is creating a session named as ‘laravel_session’ in evrey login and destroying
it the same in logout.

I just made the simple hack

Step 1 :

Open the session handler file.

It should be under config->session.php

Step 2 :

Renamed the name ‘laravel_session’ to my project name

'cookie' => 'bizarrechat_laravel_session',

And the Problem was solved !!

So, It will create the session with suffix to project name.

Note : You can dig the source file to explore a bit more


Blog Search
Tags
  • Sysaxiom (4)
  • Github (8)
  • Windows (1)
  • php (25)
  • General Tips (0)
  • GoogleMaps (2)
  • Google App Script (1)
  • Heroku (4)
  • Laravel Middleware (1)
  • xampp (1)
  • Terminal (1)
  • TechCrunch (1)
  • Ubuntu (3)
  • MySQL (2)
Side Widget
can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!