Page created: 24 Jul 2019
|
Page updated: 8 Feb 2022
The code snippet below demonstrates the use of the writeTokenToHTTPResponse
method:
<?php
# Use and instantiate an agent
use pingidentity\opentoken\agent;
$myagent = new Agent();
# Setup an array of values
$myvalues = array(TOKEN_SUBJECT => “$userId”);
# Generate and write the token to a cookie (assuming that's
# our configuration)
$myagent->writeTokenToHTTPResponse($myvalues);
?>