| 1 | <?php |
||
| 11 | class Session extends Component |
||
| 12 | { |
||
| 13 | const CORE_NAMESPACE = 'saml.core'; |
||
| 14 | const REQUEST_ID_KEY = 'request.id'; |
||
| 15 | const HASH_ALGO = 'sha256'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param $id |
||
| 19 | */ |
||
| 20 | public function setRequestId($id) |
||
| 21 | { |
||
| 22 | \Craft::$app->getSession()->set( |
||
| 23 | $this->getName(static::REQUEST_ID_KEY), |
||
| 24 | $id |
||
| 25 | ); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return string |
||
| 30 | */ |
||
| 31 | public function getRequestId() |
||
| 32 | { |
||
| 33 | return \Craft::$app->getSession()->get( |
||
| 34 | $this->getName(static::REQUEST_ID_KEY) |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | public function getId() |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @param $key |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | protected function getName($key) |
||
| 54 | } |
||
| 55 |