| 1 | <?php namespace Comodojo\Cookies; |
||
| 21 | class SecureCookie extends EncryptedCookie {
|
||
| 22 | |||
| 23 | /** |
||
| 24 | * Create a client-specific key using provided key, |
||
| 25 | * the client remote address and (in case) the value of |
||
| 26 | * HTTP_X_FORWARDED_FOR header |
||
| 27 | * |
||
| 28 | * @param string $key |
||
| 29 | * |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | protected static function encryptKey($key) {
|
||
| 51 | |||
| 52 | } |
||
| 53 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: