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

Jmac's avatar
Level 5

Cannot set session variable thru AJAX, works if I visit route

I have strange problem driving me nuts. I cannot set a session variable thru AJAX/jQuery, but it works if I visit the page .

I cannot see any errors and I receive OK responses in the AJAX-call.

I am using a standard $.get in jQuery. If I copy the AJAX-request URL from Chrome's dev tools and paste into the browser's address field the session variable is set.

L5.1 Session File Driver

Any hints appreciated!

0 likes
1 reply

Please or to participate in this conversation.