Title: Usage or misunderstood ?
Last modified: February 11, 2017

---

# Usage or misunderstood ?

 *  Resolved [javdude](https://wordpress.org/support/users/javdude/)
 * (@javdude)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/usage-or-misunderstood/)
 * I have a WP page that calls a script with following lines in it …
 * session_start();
    $_SESSION[‘myKey’] = “Some data I need later”; header(‘Location:
   [http://wp.achieve-it.co.uk/test-php&#8217](http://wp.achieve-it.co.uk/test-php&#8217););
 * As you can see another page called test-php is called on the last line which 
   contains only the following lines …
 * <?php
    print “before”; print “myKey is set: “.$_SESSION[‘myKey’]; print “after”;?
   >
 * The out put is ..
 * beforemyKey is set: after
 * Which means the plugin has NOT worked.
 * Can you help explain why this simple test of the plugin does not work?
    Have 
   I misunderstood what the plugin is about?
 * Many Thanks in advance.

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

 *  Plugin Contributor [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/usage-or-misunderstood/#post-8801683)
 * Hi [@javdude](https://wordpress.org/support/users/javdude/):
 * > Which means the plugin has NOT worked.
 * Your assessment is correct, in fact.
 * > Can you help explain why this simple test of the plugin does not work?
   >  Have
   > I misunderstood what the plugin is about?
 * The test you’ve provided doesn’t work as expected because your `test.php` script
   doesn’t load WordPress (and the plugin).
 * Your WordPress page has loaded WordPress (and the plugin), which means WP Native
   PHP Sessions is properly configured.
 * Your `test.php` script is executed directly, without loading WordPress, which
   means WP Native PHP Sessions isn’t loaded, and doesn’t handle your script’s interactions
   with PHP sessions.
 * When the WP Native PHP Sessions plugin is loaded, it [registers a series of PHP callbacks](https://github.com/pantheon-systems/wp-native-php-sessions/blob/34a13fcfda72397472b335001bcd3934db51adf2/pantheon-sessions.php#L132)
   to handle interactions with the PHP sessions API. Loading the plugin is a necessary
   step to offload sessions to the database.
 *  Thread Starter [javdude](https://wordpress.org/support/users/javdude/)
 * (@javdude)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/usage-or-misunderstood/#post-8814264)
 * Hi Daniel,
 * Thank you for your reply, much appreciated.
 * I am not a professional WP developer and would be grateful if you could give 
   me a couple of steps to follow to get around this problem.
 * Many thanks for you help on this.
 * Javid.
 *  Plugin Contributor [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/usage-or-misunderstood/#post-8814699)
 * > Thank you for your reply, much appreciated.
 * You’re welcome!
 * > I am not a professional WP developer and would be grateful if you could give
   > me a couple of steps to follow to get around this problem.
 * I’m sorry, but the scope of support offered through this forum is limited to 
   the usage of WP Native PHP Sessions, not general WordPress development questions.
 *  Thread Starter [javdude](https://wordpress.org/support/users/javdude/)
 * (@javdude)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/usage-or-misunderstood/#post-8814769)
 * I understand. Thanks for all your help.

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

The topic ‘Usage or misunderstood ?’ is closed to new replies.

 * ![](https://ps.w.org/wp-native-php-sessions/assets/icon-256x256.png?rev=3411177)
 * [Native PHP Sessions](https://wordpress.org/plugins/wp-native-php-sessions/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-native-php-sessions/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-native-php-sessions/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-native-php-sessions/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-native-php-sessions/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-native-php-sessions/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [javdude](https://wordpress.org/support/users/javdude/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/usage-or-misunderstood/#post-8814769)
 * Status: resolved