Create Session In WordPress

/* create session in wordpress */
if (!session_id()) {
 session_start();
}

 if ( isset( $_POST['wp-submit'] ) ){

 $_SESSION['username']=$_POST['log'];

 }

Leave a Comment