Sunday, October 20, 2013
Maintaining and Using Sessions in Wordpress
Sunday, October 20, 2013 by Unknown
Hiiii, We all know the importance of maintaining sessions and session variables on our website and use the value of that variables on any page of our website once they are declared and assigned with some value.
But what happen when you have to maintain sessions in Wordpress for some custom module.Wordpress by default doesn't maintain sessions as used in PHP and it then also you do so, that value declared to session variable will be accessible once on that page but you cannot use that value on any other pages.
Steps to maintain Sessions in Wordpress :
1. Firstly install WP Session Manager plugin in wordpress.2. After installing this plugin , just write as shown below to start a session and declare a value to some session variable:
$wp_session = WP_Session::get_instance(); // Starting a Session
$wp_session['Session variable Name']= "Your value"; // like $wp_session['my_sess']="MyCodeStock";
Now you can use you session variable on any page in you wordpress just like Session variables used in PHP website.
NOTE : WP Session Manager allows same functionality of Sessions as in Core PHP and with this plugin you can use session variables in wordpress same as Core PHP.
Hope you like this post……..Please Comment…………!!!!!!!!!
Tags: WORDPRESS
Subscribe to:
Post Comments (Atom)
0 Responses to “Maintaining and Using Sessions in Wordpress”
Post a Comment