I can’t get sessions to work. So far I have tried:
1. Starting the session in wp-config.php
2. Starting the session in functions.php
3. Starting the session from within pages in my theme
4. Starting the session from the main index page
5. Adding _SESSION to the list of variables not to be unset by the wp_unregister_GLOBALS() function
6. Adding specific session variable names to the list of variables not to be unset by the wp_unregister_GLOBALS() function
7. Turning off register_globals in php.ini
Sessions do work on some pages when I start the session in wp-config.php, functions.php and the main index page, but not in all pages, so I guess that the variables aren’t being unset, but that it’s a problem with the call to start the session. It seems that sessions work in my post pages, but not in pages such as archive etc. which leads me to suspect a problem with my template, but as I don’t know at what stage files such as wp-config are called, I can’t see where the problem is.
Plesae help. This is driving me insane.
- The topic ‘Sessions not working – Tried everything!’ is closed to new replies.