Hi,
I’ve enabled PHP in a number of templates in a template group. I want to restrict access to certain templates based on a session been set. When a visitor submits a form it creates a session and redirect to a competition entry page, see code below.
$_SESSION["entered_code"] = "submitted";
header( 'Location: domain.com/henry/entry/'.$code ) ;
On the entry page I want ot check if the session has been set, if not redirect the visitor back to the index page.
if( ! isset($_SESSION["entered_code"])){
header( 'Location: domain/henry' ) ;
}
The problem is the session id on the entry page is different to the id on the page where I want to check the session, so the session is not available.
Is there a way to set and acces PHP sessions across different pages.
Thanks
Wayne.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.