Title: access variable from multiple pages
Last modified: August 19, 2016

---

# access variable from multiple pages

 *  [vanillaxtrakt](https://wordpress.org/support/users/vanillaxtrakt/)
 * (@vanillaxtrakt)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/access-variable-from-multiple-pages/)
 * I wrote a plugin a while back, and needed to store some variable information 
   between pages, so I used PHP sessions. At some point, I realized my WP (it’s 
   WPMU, actually) site was slower, so I disabled my plugins one by one. I realized
   my plugin was causing the performance issues, and I narrowed them down to one
   line:
 * session_start();
 * As soon as I commented out that line, my site started working fine again. Of 
   course, this broke my plugin…
 * I Googled a bunch for WordPress and PHP sessions, and I saw that many people 
   said they didn’t work with WordPress, but nobody saying they worked but caused
   performance issues.
 * So anyway, I looked into other alternatives for doing the same thing. I tried
   using the WP cache ([http://codex.wordpress.org/Function_Reference/WP_Cache](http://codex.wordpress.org/Function_Reference/WP_Cache)),
   but it seems to dump the data when I try accessing it from another page within
   my plugin.
 * Is this the intended functionality of the WP cache? What other options do I have?
   Would it be wise to create a new global variable?
 * The information only needs to be saved for the user’s session while he/she is
   using the plugin. It doesn’t need to be saved in the database.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [@mercime](https://wordpress.org/support/users/mercime/)
 * (@mercime)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/access-variable-from-multiple-pages/#post-1273141)
 * I suggest you take this to the WPMU forums – [http://mu.wordpress.org/forums/](http://mu.wordpress.org/forums/)
 *  [@mercime](https://wordpress.org/support/users/mercime/)
 * (@mercime)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/access-variable-from-multiple-pages/#post-1273140)
 * I suggest you take this to the WPMU forums – [http://mu.wordpress.org/forums/](http://mu.wordpress.org/forums/)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘access variable from multiple pages’ is closed to new replies.

## Tags

 * [Coding](https://wordpress.org/support/topic-tag/coding/)
 * [variable](https://wordpress.org/support/topic-tag/variable/)
 * [wpmu](https://wordpress.org/support/topic-tag/wpmu/)

 * 2 replies
 * 2 participants
 * Last reply from: [@mercime](https://wordpress.org/support/users/mercime/)
 * Last activity: [16 years, 6 months ago](https://wordpress.org/support/topic/access-variable-from-multiple-pages/#post-1273140)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
