I have the following plugin: http://wordpress.org/support/plugin/wp-session-manager
I cannot work out how to use the session variables in WordPress. From what I unde
Introducing WP_Session:
Example :
global $wp_session;
$wp_session['user_name'] = 'User Name'; // A string
$wp_session['user_contact'] = array( 'email' => 'user@name.com' );// An array
$wp_session['user_obj'] = new WP_User( 1 ); // An object
Wordpress session functions:
Replace:
global $wp_session;
With:
$wp_session = WP_Session::get_instance();
Make sure you add $wp_session = WP_Session::get_instance();
before you try to echo the variable on page 2.
function.php
filefunction register_my_session(){ if( ! session_id() ) { session_start(); } } add_action('init', 'register_my_session');
$_SESSION['something'] = $xyz