Title: Using $_SESSION in hooked function not working
Last modified: August 31, 2016

---

# Using $_SESSION in hooked function not working

 *  [kevinbrands](https://wordpress.org/support/users/kevinbrands/)
 * (@kevinbrands)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/using-_session-in-hooked-function-not-working/)
 * Hello,
 * I’m building a custom theme and I’m trying to do the following:
 * – In my functions.php file I start a session on init
    – I’ve added a couple of
   values to $_SESSION – I’ve written a function and added it with a filter hook–
   I’m trying to get some $_SESSION variables inside the function
 * > I’m stuck getting the $_SESSION variables. Nothing I’ve tried seems to work.
   Does anybody have an idea what I’m doing wrong?

The topic ‘Using $_SESSION in hooked function not working’ is closed to new replies.

## Tags

 * [$_session](https://wordpress.org/support/topic-tag/_session/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [kevinbrands](https://wordpress.org/support/users/kevinbrands/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/using-_session-in-hooked-function-not-working/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
