/** * Save the given HTTP POST data and the destination where it should be posted to a given session. * * @param \SimpleSAML_Session $session The session where to temporarily store the data. * @param string $destination The destination URL where the form should be posted. * @param array $data An associative array with the data to be posted to $destination. * * @return string A random identifier that can be used to retrieve the data from the current session. * * @author Andjelko Horvat * @author Jaime Perez, UNINETT AS <*****@*****.**> */ private static function savePOSTData(\SimpleSAML_Session $session, $destination, $data) { // generate a random ID to avoid replay attacks $id = Random::generateID(); $postData = array('post' => $data, 'url' => $destination); // save the post data to the session, tied to the random ID $session->setData('core_postdatalink', $id, $postData); return $id; }