$_SESSION variables work perfectly on my local machine but returns NULL on development webserver

I’m using a hook into init where I add a certain timestamp in order to include a splash screen into within my WordPress project.

Basic logics of the script is:

add_action(“init”, “my_function”, 1)
my_function handles all the logic and stores the $_SESSION variables I need else where

When I try to check the variables on my local machine (MAMP, Mac) it works perfectly fine. I can get the timestamp and simply check if the timestamp + offset is greater than the current time. If / else I will show the screen.

I pushed the scripts to my online development server however and for some kind of reason the $_SESSION variable returns NULL entirely. I’ve read things about destroying the session after usage, but that doesn’t really work.

Wondering, does anyone know what’s wrong here? I honestly have no idea… Besides; this whole chapter is very poorly documented on WordPress’ side which leaves me no other choice than asking here…

Read more here:: $_SESSION variables work perfectly on my local machine but returns NULL on development webserver

Leave a Reply

Your email address will not be published. Required fields are marked *