BourneShady
BourneShady

Reputation: 935

Issues on expiration of laravel 4.2 session

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

Answers (1)

Dawlatzai Ghousi
Dawlatzai Ghousi

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

Related Questions