How safe is it to store sessions with Redis?

Redis is perfect for storing sessions. All operations are performed in memory, and so reads and writes will be fast. The second aspect is persistence of session state. Redis gives you a lot of flexibility in how you want to persist session state to your hard-disk. You can go through http://redis.io/topics/persistence to learn more, but … Read more

In Laravel, the best way to pass different types of flash messages in the session

One solution would be to flash two variables into the session: The message itself The “class” of your alert for example: Session::flash(‘message’, ‘This is a message!’); Session::flash(‘alert-class’, ‘alert-danger’); Then in your view: @if(Session::has(‘message’)) <p class=”alert {{ Session::get(‘alert-class’, ‘alert-info’) }}”>{{ Session::get(‘message’) }}</p> @endif Note I’ve put a default value into the Session::get(). that way you only … Read more

Authentication: JWT usage vs session

JWT doesn’t have a benefit over using “sessions” per se. JWTs provide a means of maintaining session state on the client instead of doing it on the server. What people often mean when asking this is “What are the benefits of using JWTs over using Server-side sessions“. With server-side sessions, you will either have to … Read more