Title: $_SESSION variable not being read
Last modified: August 19, 2016

---

# $_SESSION variable not being read

 *  [rhino18](https://wordpress.org/support/users/rhino18/)
 * (@rhino18)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/_session-variable-not-being-read/)
 * I am storing an array in a $_SESSION variable–just random information, nothing
   that needs security. I added $_SESSION to the list of not-unset globals in wp-
   settings and moved the start_session() statement to various places will testing.
 * The behavior involves a flawless insertion of the array into $_SESSION[‘junk’]
   in a file named session.php that’s on the same directory as wordpress, which 
   is site.com/wordpress/session.php.
 * I have a file for playing with the array at site.com/session_test.php. The array
   and the session ID show up every time there.
 * And then I use the session variable at functions.php and my theme files. These
   files seem to just pick random times to read the variable. As I navigate around,
   the array shows up just as it had been inserted originally, then the next page
   I go to, it is missing. Then the next it is back. Then it is unset and won’t 
   show up anywhere and needs to be re-set. On each page, the session ID will print
   out the same each time. It’s just the variable that disappears eventually (usually
   after showing up sporadically a few times.)
 * Is this a server problem, a problem of different directories, or just some WordPress
   handling of sessions I don’t understand. Has anyone had experience with this?

The topic ‘$_SESSION variable not being read’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [rhino18](https://wordpress.org/support/users/rhino18/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/_session-variable-not-being-read/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
