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

JJK's avatar
Level 1

Session doesn't save nor persist

I seem to have a problem with sessions.

Each time I perform a POST request, it saves a new session file. If I perform a GET request, it doesn't save or load any file, because when I do dd(session()->all()) it pops nothing but _token which surprisingly changes every time I refresh page.

Edit

Just checked locally, same result. When I redirect from method (POST) to home (GET, '/') - the $request is empty and so is, still the session.

0 likes
9 replies
jlrdw's avatar

Make sure you have permissions in that folder set correctly.

JJK's avatar
Level 1

@jlrdw Does this apply to webhosts or windows servers?

Also, here's ss from filezilla:

https://i.imgur.com/RCwdUTh.png

jove's avatar

@jjk That doesn't display the directories below that. Also why on earth do you have 777?

Does this apply to webhosts or windows servers?

By this you mean what?

JJK's avatar
Level 1

@jove I've set it to 777 only for the purpose of eliminating permissions as potential cause.

@jlrdw Yes, ofcourse.

I think it's related to my htaccess and the fact that index.php is outside of the folder.

It's like that:

~/index.php (with changed paths to lead properly to vendor etc.)
~/.htaccess
~/Bonus/
~/Bonus/public/ <- no .htaccess or index.php here.
JJK's avatar
Level 1

Because the customer has a server and refuses to let me access apache and it's config.

Anyways, I've fixed the issue by moving every file from public to root, thought it's not a perfect solution.

JJK's avatar
Level 1

I'll try this later. Thank you!

Please or to participate in this conversation.