Understanding custom globals in wp
-
I am working on a plugin and am trying to keep some history of a visitor’s landing page interest, for simplicity lets say I want to remember if they are interested in cats or dogs. I can store this in a cookie if they have cookies enabled, or in a session variable if not, (possibly the session variable is best because that should work for everyone).
But then I thought – how about a global? If I set a global in my plugin, when does it get lost? When they change to a new page in the site? or does it remain while they navigate around? What if someone else comes to the site? would the global get changed for everyone or does everyone have their own instance of it running?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Understanding custom globals in wp’ is closed to new replies.