Pages

Saturday, June 1, 2013

Enable session in wordpress


Normally session will not work in wordpress and we need to enable session. We can enable it by initializing. Function for initializing session is
function init_sessions() {
if (!session_id()) {
session_start();
}
}
add_action('init', 'init_sessions');

Just copy the code and paste it in your function.php