Hello,
I have the following problem.
I an’t use sessions in modx!
When I do this: $_SESSION[’mysession’] = ’test content’; and I go to another page, the session is empty.
How can I turn on the usage of sessions?
greets,
Marc
-
☆ A M B ☆
- 24,524 Posts
Is this in a snippet? If it’s in an external .php file you would need to get the MODx session_id and explicitly start that session.
You could also be accessing the pages from different domains:
http://www.domain.com will not have the same session as
http://domain.com.
Another session issue sometimes comes up if the site is hosted on a server cluster that is not properly configured to use a common server for the temporary storage where the session files are located.
-
MODX Staff
- 10,725 Posts
Or you have the page cached and are not calling the snippet uncached. This would render the cached result.