Title: $_SESSION
Last modified: August 18, 2016

---

# $_SESSION

 *  [1stpixel](https://wordpress.org/support/users/1stpixel/)
 * (@1stpixel)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/_session/)
 * I searched the archives, but couldn’t find any clue:
    Why does WP delete all 
   my $_SESSION variables ?

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

 *  [NuclearMoose](https://wordpress.org/support/users/nuclearmoose/)
 * (@nuclearmoose)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/_session/#post-142996)
 * How have you confirmed that it is WordPress that is doing this? Could it be an
   issue with PHP and your server?
 *  Thread Starter [1stpixel](https://wordpress.org/support/users/1stpixel/)
 * (@1stpixel)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/_session/#post-143010)
 * I’m using WAMP Server, only for testing purposes, and heve never ever before 
   encountered such issue. it won’t work only in my WP installation.
 * All i use is a $_SESSION[‘test’] = “foo”;
    and on any other page where i echo
   it it is gone.
 * There are some post about $_SESSION kills here, but they never got an answer.
 * hopefully this is not the case withthis one.
 *  [NuclearMoose](https://wordpress.org/support/users/nuclearmoose/)
 * (@nuclearmoose)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/_session/#post-143013)
 * Hmm…well, then we will hope that a coder or two will pop by and see if they can
   shed any light on the subject.
 *  [harrylove](https://wordpress.org/support/users/harrylove/)
 * (@harrylove)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/_session/#post-143281)
 * Has anyone had any luck with this since the last post?
 * I’ve noticed that if I point my browser directly at a page’s template.php file
   vs. accessing the page through mod_rewrite, the session is set.
 * So, if I do [http://mysite/mypage](http://mysite/mypage), the session is not 
   set. But, if I try to access the template file being used by mypage, e.g. [http://mysite/wp-content/themes/mysite/mytemplate.php](http://mysite/wp-content/themes/mysite/mytemplate.php),
   the session is set.
 * That leads me to believe that somewhere in between making the page request and
   getting redirected silently to the template file for the page, WP or mod_rewrite
   or Apache is inserting some content or thwarting the session_start().
 * Can anyone confirm? Or know what the issue is?
 *  [mynameisgabe](https://wordpress.org/support/users/mynameisgabe/)
 * (@mynameisgabe)
 * [20 years, 7 months ago](https://wordpress.org/support/topic/_session/#post-143287)
 * any answer on this? i’m seeing the same thing.
 *  [ment0r](https://wordpress.org/support/users/ment0r/)
 * (@ment0r)
 * [20 years, 7 months ago](https://wordpress.org/support/topic/_session/#post-143289)
 * i confirm this. $_SESSION doesnt work so good in wp. you need to add session_start
   everywhere within the templates/script.. its just crap 🙁

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

The topic ‘$_SESSION’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 6 replies
 * 5 participants
 * Last reply from: [ment0r](https://wordpress.org/support/users/ment0r/)
 * Last activity: [20 years, 7 months ago](https://wordpress.org/support/topic/_session/#post-143289)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
