|
55 | 55 | * RememberMe Package Settings |
56 | 56 | * ---------------------------------------------------------------------- |
57 | 57 | * See https://github.com/gbirke/rememberme for an explanation of these settings |
| 58 | + * |
| 59 | + * Note that the 'domain' field can be set to match your top-level-domain if you |
| 60 | + * want to send the rememberme to all hosts in your domain. An automatic config |
| 61 | + * of this can be done in your config.php with code similar to this: |
| 62 | + * |
| 63 | + * if (!empty($_SERVER['SERVER_NAME']) && filter_var($_SERVER['SERVER_NAME'], \FILTER_VALIDATE_IP) === false) { |
| 64 | + * $darr = explode(".", $_SERVER['SERVER_NAME']); |
| 65 | + * array_shift($darr); |
| 66 | + * $conf['session']['cookie_parameters'] = [ "lifetime" => 86400, "domain" => ".".join(".", $darr), "path" => "/" ]; |
| 67 | + * $conf['remember_me'] = [ "domain" => ".".join(".", $darr) ]; |
| 68 | + * } |
| 69 | + * |
| 70 | + * (Or, for production, you can hard-code the domain rather than calculating it on each page load) |
| 71 | + * |
| 72 | + * This is DELIBERATELY NOT TURNED ON BY DEFAULT! |
| 73 | + * |
| 74 | + * If you enable the 'domain' (on both the session and the remember_me cookies) |
| 75 | + * you will be sending your authentication cookies to every machine in the |
| 76 | + * domain you are using. This may not be bad if you control the domain, but |
| 77 | + * if you are using a VPS and the hostname of the machine you are connecting to |
| 78 | + * is, for example, host2.vps.blah.com, and you connect to host20.vps.blah.com, |
| 79 | + * your browser will send your (super secret) cookies to host20.vps.blah.com. |
| 80 | + * |
| 81 | + * You only want to turn this on if you want machine1.foo.com to receive the |
| 82 | + * cookies that THIS MACHINE (machine2.foo.com) set. |
58 | 83 | */ |
59 | 84 | 'remember_me' => [ |
60 | 85 | 'cookie' => [ |
61 | 86 | 'name' => 'rememberme', |
62 | 87 | ], |
| 88 | + 'domain' => null, |
63 | 89 | 'expire_time' => 604800, |
64 | 90 | 'session' => [ |
65 | 91 | 'path' => '/', |
|
0 commit comments