I am using Wordpress and Woocommerce, I am using PHP Sessions to Display Post ID in Email Notification, Sessions work fine with Free Product, But When Product is paid/premium and got purchased with any Payment Method Option like PayPal, PayTM, PayUMoney, InstaMojo etc, Sessions work only for 10-15 mins and automatically got stop working, It's weird but I don't know why this happening.
One more thing I wanna mention when session stop working and I do any change in woocommerce code from Cpanel or Wordpress Admin Panel Like Enable/Disable Tax Option, Sessions Automatically start working again for next few minutes.
Page 1
<?php session_start();
$wp_session = WP_Session::get_instance();
$wp_session['regnumber'] = $post->ID; ?>
Page2
session_start();
echo $wp_session['regnumber'];
Also Tried with $_SESSION
I want this session to work every time, or is there any alternate option available ?
Any Help will be appreciatable...