I get the following error TokenMismatchException in compiled.php line 2930:
The code works on Red Hat serverwith php 5.6, I also tested this on Ubuntu serverrunning php 5.5.9, it worked fine. It also works fine locally.
It seems that in the original request GET, 2 session files are created in storage/framework/sessions, which means the form is submitted through POST, then the session is different.
I checked for
- Redirection
- Server Date / Time Problem
- Configuration problems within
session.phpandapp.php
The strangest thing GETis that 2 session files are created in the request .
As soon as you press the login button, you will be taken to middleware csrfsaying that the tokens do not match.
I am using an HTML generator for forms, which means it _tokeninstalls, so it does not need to be done manually.
Form code
{!! Form::open(['action' => 'Auth\AuthController@login']) !!}
<div class="panel">
<div class="panel-title">
Login
</div>
<div class="panel-body">
<div class="grid">
<div class="grid-2-4 grid-prepend-1-4 grid-append-1-4">
@include('shared._errors')
<div class="field">
{!! Form::label('username', 'Employee username') !!}
{!! Form::text('username') !!}
</div>
<div class="field">
{!! Form::label('password', 'Password') !!}
{!! Form::password('password') !!}
</div>
<div class="actions">
{!! Form::submit('Login', ['class' => 'button large']) !!}
</div>
</div>
</div>
</div>
</div>
{!! Form::close() !!}
Session Configuration
<?php
return [
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 45,
'expire_on_close' => true,
'encrypt' => false,
'files' => storage_path('framework/sessions'),
'connection' => null,
'table' => 'sessions',
'lottery' => [2, 100],
'cookie' => 'geeksquad_form_session',
'path' => '/',
'domain' => '.'.config('app.domain'),
'secure' => false,
];
If there is anything else that would be helpful, let me know.