I'm trying to transfer value "text1" from one page to another on Wordpress but can't get it working. After submit from First page to Second page Session array on second page appears to be empty.
First Page
<?php
session_start();
$_SESSION['text1'] = $_POST['text1'];
?>
<?php
if(isset($_POST['submitted'])) {
header("Location: ?page_id=5327");
} ?>
<form id="contactForm" action="http://www.bpetrade.com/?page_id=5327" method="post">
<input name="text" type="text" />
<input type="submit" />
<input id="submitted" name="submitted" type="hidden" value="true" />
</form>
Second page
<?php print_r($_SESSION); ?>
And it returns empty array on second page.