I'm have a code show another product was seen in single product page.
my idea : save id of posts to array by session:
Then using loop or foreach to show title, img, link ...etc...
MY CODE
session_start();
$_SESSION['id'] = get_the_ID();
$cart = array (
'id' => $_SESSION['id'],
);
$_SESSION['cart'][] = $cart; // array id
But, when user closed browser. all data not save.
And i want convert session to Cookie to save for one month.
How to change for the right ways.
Please help to the idea for this Solution .
Thankyou all.