wp-native-php-sessions icon indicating copy to clipboard operation
wp-native-php-sessions copied to clipboard

Force start and caching issue

Open nicolasricci opened this issue 2 years ago • 0 comments

Hello,

Thanks for this great plugin.

My use case is that I am setting a variable in session after an ajax call setting a region code. This session variable is then used to hide/display some blocks in various pages.

I am facing a couple of issues that I am not sure how to resolve if you can help.

I have to force a session_start() before setting any session variable or it won't store anything in the database. Not sure it was meant to be that way.

Everything works fine then until I enable WPRocket ... dozen of sessions are then initialized (probably because of my session_start) at each page load and the session is not saved properly when changing region.

Both issues are probably related so hopefully it should not be too difficult to find a solution :-)

Thanks for your help Nicolas

nicolasricci avatar Feb 09 '23 21:02 nicolasricci