2

some help appreciated on this laravel installation.

The problem (so far), cannot login. Almost vanilla Laravel login form so it includes the CSRF stuff.

The code is on a shared hosting. It previously worked on other hosting, and presently works locally on dev.

Any suggestions?

Non working environment is a new shared hosting, I've tried 777'ing my storage folder to see if it's permissions, same issue.

 <form class="form-horizontal" role="form" method="POST" action="{{ url('/login') }}">
    <input type="hidden" name="_token" value="{{ csrf_token() }}">
    <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
        <label for="email" class="col-md-4 control-label">E-Mail Address</label>

        <div class="col-md-6">
            <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus>

            @if ($errors->has('email'))
            <span class="help-block">
                <strong>{{ $errors->first('email') }}</strong>
            </span>
            @endif

        </div>
    </div>

    <div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
        <label for="password" class="col-md-4 control-label">Password</label>

        <div class="col-md-6">
            <input id="password" type="password" class="form-control" name="password" required>

            @if ($errors->has('password'))
            <span class="help-block">
                <strong>{{ $errors->first('password') }}</strong>
            </span>
            @endif
        </div>
    </div>

    <div class="form-group">
        <div class="col-md-6 col-md-offset-4">
            <div class="checkbox">
                <label>
                    <input type="checkbox" name="remember"> Remember Me
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-md-8 col-md-offset-4">
            <button type="submit" class="btn btn-primary">
                Login
            </button>

            <a class="btn btn-link" href="{{ url('/password/reset') }}">
                Forgot Your Password?
            </a>
            <a class="btn btn-link" href="{{ url('/register') }}">
                Don't Have A Login?
            </a>
        </div>
    </div>
    {!! csrf_field() !!}
</form>

Handler.php is returning:

TokenMismatchException {#490 ▼
  #message: ""
  #code: 0
  #file: "/home1/artfocu2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php"
  #line: 71
  trace: {▼
    /home1/artfocu2/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:71 {▶}
    /home1/artfocu2/public_html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149 {▶}
    /home1/artfocu2/public_html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 {▶}
aynber
  • 22,380
  • 8
  • 50
  • 63
stoneferry
  • 177
  • 1
  • 2
  • 11
  • Possible duplicate of [TokenMismatchException in VerifyCsrfToken.php Line 67](https://stackoverflow.com/questions/34866404/tokenmismatchexception-in-verifycsrftoken-php-line-67) – ficuscr Jun 04 '19 at 18:36
  • You don't really need both `` and `{!! csrf_field() !!}`; the second is just a different method of doing the first after all. – Tim Lewis Jun 04 '19 at 18:37
  • Remove `` and add `@csrf` instead. – tcj Jun 04 '19 at 18:40
  • Be sure your session environment is correct in your .env: `SESSION_SECURE_COOKIE=true`. Also make sure your page is fresh. – Adam Rodriguez Jun 04 '19 at 18:48

0 Answers0