Reputation: 935
in my login i have created sessions, Session::put('lid','somevalue')
and Session::put('ltype','somevalue')
and in my default blade i did something like
@if(Session->has('ltype')
<div>Hello</div>
@else
//redirect to login page
in my session.php in app/config i already changed the timeout to 5 meaning 5 minutes. i timed it but its already 8 minutes when i refreshed my page it still displayed Hello
where it should be redirected to the login already because the session is expired already. am i doing something wrong?
Upvotes: 0
Views: 173
Reputation: 3978
You can use the following code:
@if(Session::has('ltype')
<div>Hello</div>
@else
you must use ::
instead of ->
because Session is a static method.
Upvotes: 1