Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jpmg's avatar
Level 13

Problem in session Laravel and Xampp

Good afternoon.. I have a project in laravel that was working fine, but suddenly i got the error "session has expired" and i don't know why?? i haven't made any change in any forms lately and everting was working just fine bout today the error "session has expired" keep showing all the time.

in logs says...

	[2020-09-04 09:30:36] production.ERROR: No application encryption key has been specified. {"exception":"[object] (RuntimeException(code: 0): No application encryption key has been specified. at C:\xampp\htdocs\wfortin\vendor\laravel\framework\src\Illuminate\Encryption\EncryptionServiceProvider.php:44)

[stacktrace]

I'm working with Laravel 5.7 Xampp

can some one help me!!! please and thankyou

0 likes
8 replies
jpmg's avatar
Level 13

hello.. my .env look like this.

APP_NAME='El Fortin SWv1' APP_ENV=local APP_KEY=base64:UzMRZycVzCQWHTq48pUua3wNuYlPh5i846wExwPeaO8= APP_DEBUG=true APP_URL=http://localhost

LOG_CHANNEL=stack

jpmg's avatar
Level 13

I did what you say, but i still have the problem, can you help please.

jlrdw's avatar

I have a project in laravel that was working fine, but suddenly i got the error "session has expired"

Are you saying you made no code changes, did you do any updating or upgrading?

jlrdw's avatar
jlrdw
Best Answer
Level 75

Wait, I bet you forgot to include the csrf token on a form, check that....

Snapey's avatar

something odd. You say the .env file contains APP_ENV=local

but the error log says

production.ERROR:

for some reason it is not reading your .env file

You can check the config in tinker. This will give you a definitive answer regarding the config.

In tinker try

>>> config('app')
jpmg's avatar
Level 13

thanks for all the answer, i found that in 2 forms there were not @csrf

Please or to participate in this conversation.