Skip to content

Commit bffbc4a

Browse files
Updated flat-php advanced example
1 parent aa6fdbe commit bffbc4a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

examples/flat-php/advanced.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?php
22

33
/*
4-
In this example, we will use the session object instead of cookies.
5-
And we will handle the redirect ourselves instead of relying on CrowdHandlee\GateKeeper
4+
In this example, we will handle the redirect ourselves instead of relying on CrowdHandler\GateKeeper
65
We will also specify a slug to redirect to if the request check fails.
76
*/
87

@@ -11,9 +10,8 @@
1110
$api = new CrowdHandler\PublicClient('ace1f8062f2df869a5fb0cbd69f51c10d2821dd1e4519e110206eca9e3db86c8'); // your public key here.
1211
$ch = new CrowdHandler\GateKeeper($api);
1312
$ch->setSafetyNetSlug('sandbox'); // users will be directed to a known slug (must be one of yours) if API request or response fails
14-
$ch->setToken( (isset($_URL['ch-id']) ? $_URL['ch-id'] : isset($_SESSION['ch-id'])) ? $_SESSION['ch-id'] : null );
13+
$ch->setToken( isset($_SESSION['ch-id']) ? $_SESSION['ch-id'] : null );
1514
$ch->checkRequest();
16-
$_SESSION['ch-id'] = $ch->result->token; // we do not recommend using default session for token storage, this is just an example.
1715
if(!$ch->result->promoted) {
1816
header('location:'.$ch->getRedirectUrl(), 302);
1917
}

0 commit comments

Comments
 (0)