The page has expired due to inactivity issue in laravel - php

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">Lost password?</span>
<span class="pull-right"><button type="submit" class="btn btn-success">Login</button></span>
</div>
</form>

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.

Related

why the css style did not working ? ( Laravel )

I want to ask something because I don't quite understand the file.
I want to create a Login/Register for a User and I found a tutorial to create the login and register I want.
Here tutorial website link : https://medium.com/geekculture/customize-the-login-and-register-page-for-user-admin-in-laravel-v8-9e42127d0185
and also github complete file : https://github.com/sgwebfreelancer/laravel_auth_tutorial
In the tutorial has provided a complete file with login/register for User and also Admin Panel.
But there are some problems where the css file does not seem to work and the login and register design becomes empty. It should have like a picture. Below me as well as how login and register should be:
in this tutorial it should be like this :
So how to solved this problem ? it is have any problem with css or app.blade.php file ?
login.blade.php
#extends('layouts.app')
#section('content')
<div class="container-scroller">
<div class="container-fluid page-body-wrapper full-page-wrapper">
<div class="content-wrapper d-flex align-items-center auth auth-bg-1 theme-one">
<div class="row w-100">
<div class="col-lg-4 mx-auto">
<div class="auto-form-wrapper">
<form method="POST" action="{{ route('login') }}">
#csrf
<div class="form-group">
<label class="label">Email</label>
<div class="input-group">
<input id="email" type="email"
class="form-control #error('email') is-invalid #enderror" name="email"
value="{{ old('email') }}" required autocomplete="email" autofocus>
<div class="input-group-append">
<span class="input-group-text">
<i class="mdi mdi-check-circle-outline"></i>
</span>
</div>
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="form-group">
<label class="label">Password</label>
<div class="input-group">
<input id="password" type="password"
class="form-control #error('password') is-invalid #enderror" name="password"
required autocomplete="current-password">
<div class="input-group-append">
<span class="input-group-text">
<i class="mdi mdi-check-circle-outline"></i>
</span>
</div>
#error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary submit-btn btn-block">
{{ __('Login') }}
</button>
</div>
<div class="form-group d-flex justify-content-between">
<div class="form-check form-check-flat mt-0">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" name="remember" id="remember"
{{ old('remember') ? 'checked' : '' }}> Keep me signed in
</label>
</div>
#if (Route::has('password.request'))
<a class="text-small forgot-password text-black"
href="{{ route('password.request') }}">
{{ __('Forgot Your Password?') }}
</a>
#endif
</div>
<div class="text-block text-center my-3">
<span class="text-small font-weight-semibold">Not a member ?</span>
Create new account
</div>
</form>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->
#endsection
register.blade.php
#extends('layouts.app')
#section('content')
<div class="container-scroller">
<div class="container-fluid page-body-wrapper full-page-wrapper">
<div class="content-wrapper d-flex align-items-center auth register-bg-1 theme-one">
<div class="row w-100">
<div class="col-lg-4 mx-auto">
<h2 class="text-center mb-4">{{ __('Register') }}</h2>
<div class="auto-form-wrapper">
<form method="POST" action="{{ route('register') }}">
#csrf
<div class="form-group">
<div class="input-group">
<input id="name" type="text"
class="form-control #error('name') is-invalid #enderror" name="name"
value="{{ old('name') }}" required autocomplete="name" autofocus
placeholder="Name">
<div class="input-group-append">
<span class="input-group-text">
<i class="mdi mdi-check-circle-outline"></i>
</span>
</div>
#error('name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="form-group">
<div class="input-group">
<input id="email" type="email"
class="form-control #error('email') is-invalid #enderror" name="email"
value="{{ old('email') }}" required autocomplete="email" placeholder="Email">
<div class="input-group-append">
<span class="input-group-text">
<i class="mdi mdi-check-circle-outline"></i>
</span>
</div>
#error('email')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="form-group">
<div class="input-group">
<input id="password" type="password"
class="form-control #error('password') is-invalid #enderror" name="password"
required autocomplete="new-password" placeholder="**********">
<div class="input-group-append">
<span class="input-group-text">
<i class="mdi mdi-check-circle-outline"></i>
</span>
</div>
#error('password')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
#enderror
</div>
</div>
<div class="form-group">
<div class="input-group">
<input id="password-confirm" type="password" class="form-control"
name="password_confirmation" required autocomplete="new-password"
placeholder="**********">
<div class="input-group-append">
<span class="input-group-text">
<i class="mdi mdi-check-circle-outline"></i>
</span>
</div>
</div>
</div>
<div class="form-group d-flex justify-content-center">
<div class="form-check form-check-flat mt-0">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" checked> I agree to the terms
</label>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary submit-btn btn-block">
{{ __('Register') }}
</button>
</div>
<div class="text-block text-center my-3">
<span class="text-small font-weight-semibold">Already have and account ?</span>
{{ __('Login') }}
</div>
</form>
</div>
</div>
</div>
</div>
<!-- content-wrapper ends -->
</div>
<!-- page-body-wrapper ends -->
</div>
<!-- container-scroller -->
#endsection
css file asset/css/demo_1/style.css you guys see from here
https://github.com/sgwebfreelancer/laravel_auth_tutorial/blob/main/public/assets/css/demo_1/style.css
layouts/app.blade.php file you guys can see from here
https://github.com/sgwebfreelancer/laravel_auth_tutorial/blob/main/resources/views/layouts/app.blade.php
in my console, i saw my css not load it.
In layouts.app, line 15, you have to change :
href="{{ asset('public/assets/css/shared/style.css')
to
href="{{ asset('/assets/css/shared/style.css')

laravel Error 419 PAGE EXPIRED Sorry, your session has expired. Please refresh and try again

I have tried to try login into my system. but I got always the same error. The full website is run goods but when I try to login then shows the problem "Error 419 PAGE EXPIRED Sorry, your session has expired. Please refresh and try again". my website link is https://atozwp.xyz
My login form Code is here-
<form class="ui large form" action="{{ route('login', ['redirect' => request()->redirect ?? '/']) }}" method="post">
#csrf
<div class="field">
<label>Email</label>
<input type="email" placeholder="..." name="email" value="{{ old('email', session('email')) }}" required autocomplete="email" autofocus>
#error('email')
<div class="ui negative message">
<strong>{{ $message }}</strong>
</div>
#enderror
</div>
<div class="field">
<label>{{ __('Password') }}</label>
<input type="password" placeholder="..." name="password" required autocomplete="current-password">
#error('password')
<div class="ui negative message">
<strong>{{ $message }}</strong>
</div>
#enderror
</div>
<div class="field">
<div class="ui checkbox">
<input type="checkbox" name="remember" id="remember">
<label class="checkbox" for="remember">{{ __('Remember me') }}</label>
</div>
</div>
#error('captcha')
<div class="ui negative message">
<strong>{{ $message }}</strong>
</div>
#enderror
#error('g-recaptcha-response')
<div class="ui negative message">
<strong>{{ $message }}</strong>
</div>
#enderror
#if(captcha_is_enabled('login'))
<div class="field d-flex justify-content-center">
{!! render_captcha() !!}
#if(captcha_is('mewebstudio'))
<input type="text" name="captcha" value="{{ old('captcha') }}" class="ml-1">
#endif
</div>
#endif
<div class="field mb-0">
<button class="ui yellow large fluid circular button" type="submit">{{ __('Login') }}</button>
</div>
<div class="field">
<div class="ui text menu my-0">
<a class="item right aligned" href="{{ route('password.request') }}">{{ __('Forgot password') }}</a>
</div>
</div>
</form>

Php post Function call after every x minutes

i have a function which sync api, i have to manually trigger the function from the front end by passing some parameters .
Can someone help me with script or a way to automatically sync the function after some specific time interval.
Code for frontend is below
<form
role="form"
method="POST"
action="{{ url('/admin/apisync/show') }}">
{{ csrf_field() }}
#if( ! $apis->isEmpty() )
<fieldset class="scheduler-border">
<div class="form-group{{ $errors->has('profit_percentage') ? ' has-
error' : '' }}">
<input type="text"
class="form-control"
data-validation="number"
placeholder="Profit Percentage"
data-validation-allowing="float"
id="profit_percentage"
value="{{ old('profit_percentage') }}"
name="profit_percentage">
#if ($errors->has('profit_percentage'))
<span class="help-block">
<strong>{{ $errors->first('profit_percentage') }}
</strong>
</span>
#endif
</div>
<div class="form-group">
<label for="sync_action" class="control-label">Sync Actions</label>
<label class="checkbox-inline">
<input type="checkbox"
style="margin: 0; margin-left: -20px"
name="sync_action[]"
checked
value="remove"> Remove
</label> <span class="fas fa-info-circle" data-
toggle="popover" data-trigger="hover" data-content="This will remove packages which exist
at your panel but have been removed at host"></span>
</div>
<div class="form-group" style="float:right">
<button type="submit" id="btn-proceed" class="btn btn-primary">Sync
Packages</button>
</div>
</fieldset>
#else
<span class="help-block">
<strong>No API is configured. Please update your API
configurations.</strong>
</span>
#endif
</form>

TokenMismatchException in VerifyCsrfToken.php Laravel

I have this form working on Localhost but when I upload to my shared hosting they throw VerifyCsrfToken.php line 67.
Here the code:
<form class="form-horizontal" role="form" method="POST" action="{{ url('/login') }}">
{{ csrf_field() }}
<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') }}">
#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">
#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-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
<i class="fa fa-btn fa-sign-in"></i> Login
</button>
<a class="btn btn-link" href="{{ url('/password/reset') }}">Forgot Your Password?</a>
FB Login
</div>
</div>
</form>
I added this: <meta name="csrf-token" content="{{ csrf_token() }}" /> in to my head tags, but it's not working. The token is okay, appears on the form when I inspect with Google Chrome Inspector. If someone can help on this I am really stuck here.
Check your session directory for correct permissions, it might be help.
rm -f {your_web_app}/storage/framework/sessions/*
You properly have trouble with session storage
Solution 1: Use database session driver instead of file session driver
- In .env
SESSION_DRIVER=database
- Run command
php artisan session:table
- Then
php artisan migrate
Test again
Solution 2: Continue using file session driver. Make sure you have writing permission on storage folder. Try
chmod 755 -R storage
I am using this method.
<input type="hidden" name="_token" value="{{ session()->getToken() }}">
In your view blade.

Storing data in neo4j graph DB

I've written a simple HTML code for a form:
Form code
<form method="POST" action="/ducks" novalidate>
<div class="form-group #if ($errors->has('name')) has-error #endif">
<label for="name">Name</label>
<input type="text" id="name" class="form-control" name="name" placeholder="Somebody Awesome" value="{{ Input::old('name') }}">
#if ($errors->has('name')) <p class="help-block">{{ $errors->first('name') }}</p> #endif
</div>
<div class="form-group #if ($errors->has('email')) has-error #endif">
<label for="email">Email</label>
<input type="text" id="email" class="form-control" name="email" placeholder="super#cool.com" value="{{ Input::old('email') }}">
#if ($errors->has('email')) <p class="help-block">{{ $errors->first('email') }}</p> #endif
</div>
<div class="form-group #if ($errors->has('password')) has-error #endif">
<label for="password">Password</label>
<input type="password" id="password" class="form-control" name="password">
#if ($errors->has('password')) <p class="help-block">{{ $errors->first('password') }}</p> #endif
</div>
<div class="form-group #if ($errors->has('password_confirm')) has-error #endif">
<label for="password_confirm">Confirm Password</label>
<input type="password" id="password_confirm" class="form-control" name="password_confirm">
#if ($errors->has('password_confirm')) <p class="help-block">{{ $errors->first('password_confirm') }}</p> #endif
</div>
<button type="submit" class="btn btn-success">Submit!</button>
</form>
php code
<?php
$formdata = Neo4j::makeNode();
$formdata->setProperty('frname', 'fname')
->setProperty('lsname', 'lname')
->setProperty('pname', 'pword')
->setProperty('mail','email')
->save();
$formdataId = $formdata->getId();
?>
And I've added a migration code as shown above. Controllers are good, I think so.
But the data isn't getting stored in neo4j DB. How can I fix it?

Categories