3

I have got the issue in Laravel of The page has expired due to inactivity. Please refresh and try again. I have also check {{ csrf_field() }} and its is fine but issue is still there. I have also checked about try cache, view, route clear command but again bad luck. Can any one suggest me what is the issue.

Form Code :

<form id="loginform" class="form-vertical" method="POST" action="{{ route('login') }}">
                {{ csrf_field() }}
                 <div class="control-group normal_text"> <h3><img src="{{ asset('img/logo.png') }}" alt="Logo" /></h3></div>
                <div class="control-group">
                    <div class="controls">
                        <div class="main_input_box">
                            <span class="add-on bg_lg"><i class="icon-user"> </i></span>
                            <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus placeholder="Username"/>
                            @if ($errors->has('email'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('email') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <div class="controls">
                        <div class="main_input_box">
                            <span class="add-on bg_ly"><i class="icon-lock"></i></span>
                            <input id="password" type="password" class="form-control" name="password" required placeholder="Password" />
                            @if ($errors->has('password'))
                                <span class="help-block">
                                    <strong>{{ $errors->first('password') }}</strong>
                                </span>
                            @endif
                        </div>
                    </div>
                </div>
                <div class="form-actions">
                    <span class="pull-left"><a href="#" class="flip-link btn btn-info" id="to-recover">Lost password?</a></span>
                    <span class="pull-right"><button type="submit" class="btn btn-success">Login</button></span>
                </div>
            </form>
R P
  • 711
  • 6
  • 29
  • please share the code of the `
    `
    – George Jul 01 '18 at 21:29
  • @George Please check in above I have update form code – R P Jul 01 '18 at 21:31
  • not sure if it makes any difference but can you put `@csrf` instead of `{{ csrf_field() }}` – George Jul 01 '18 at 21:47
  • I tried @csrf but getting same issue. No luck – R P Jul 01 '18 at 21:52
  • afaik in laravel 5.6 @csrf must be used instead of the way you are doing it make sure that you clear your browser cache, if you are on chrome try it in incognito mode. else execute these two commands `php artisan cache:clear` and `php artisan config:clear` – George Jul 01 '18 at 21:59
  • Yes @George I always do that after some changes but still issue is there.. – R P Jul 01 '18 at 22:04
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/174129/discussion-between-r-p-and-george). – R P Jul 01 '18 at 22:05
  • Please have a look at this answer. [Stack Answer](https://stackoverflow.com/a/46141940/8685260) – Sagar Ahuja Jul 02 '18 at 06:27

1 Answers1

2

I have solved.

I have tried all steps from https://www.5balloons.info/fixed-page-expired-due-inactivity-laravel-5/ but the issue is still on there.

The main issue was my browser catch setting.

see below screenshot for more idea.

enter image description here

R P
  • 711
  • 6
  • 29