I wondering the session was disable in wordpress. I try to find some information on using session variables in the wordpress. I tried the following method to implement session variables in the wordpress site.
I tried this way.
<?php
session_start();
$_SESSION['firstname'] = $_POST['firstname'];
?>
If i echoing the $_SESSION['firstname']
is not come’s up. So I googled to find the reason why it doesn’t support.
function register_session() {
if (!session_id())
session_start();
}
add_action('init', 'register_session');
This above method i tried and implemented but it also doesn’t work.
Right now i integrating session in plugin so i don’t want to edit the core file. Because i doing the custom plugin development.
How to enable the session in wordpress plugin. Any Suggestion would be great
Thanks.