-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6f60fe
commit 21ab076
Showing
13 changed files
with
414 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<?php | ||
|
||
namespace Config; | ||
|
||
use CodeIgniter\Config\BaseConfig; | ||
use DateTimeInterface; | ||
|
||
class Cookie extends BaseConfig | ||
{ | ||
/** | ||
* -------------------------------------------------------------------------- | ||
* Cookie Prefix | ||
* -------------------------------------------------------------------------- | ||
* | ||
* Set a cookie name prefix if you need to avoid collisions. | ||
* | ||
* @var string | ||
*/ | ||
public $prefix = ''; | ||
|
||
/** | ||
* -------------------------------------------------------------------------- | ||
* Cookie Expires Timestamp | ||
* -------------------------------------------------------------------------- | ||
* | ||
* Default expires timestamp for cookies. Setting this to `0` will mean the | ||
* cookie will not have the `Expires` attribute and will behave as a session | ||
* cookie. | ||
* | ||
* @var DateTimeInterface|integer|string | ||
*/ | ||
public $expires = 0; | ||
|
||
/** | ||
* -------------------------------------------------------------------------- | ||
* Cookie Path | ||
* -------------------------------------------------------------------------- | ||
* | ||
* Typically will be a forward slash. | ||
* | ||
* @var string | ||
*/ | ||
public $path = '/'; | ||
|
||
/** | ||
* -------------------------------------------------------------------------- | ||
* Cookie Domain | ||
* -------------------------------------------------------------------------- | ||
* | ||
* Set to `.your-domain.com` for site-wide cookies. | ||
* | ||
* @var string | ||
*/ | ||
public $domain = ''; | ||
|
||
/** | ||
* -------------------------------------------------------------------------- | ||
* Cookie Secure | ||
* -------------------------------------------------------------------------- | ||
* | ||
* Cookie will only be set if a secure HTTPS connection exists. | ||
* | ||
* @var boolean | ||
*/ | ||
public $secure = false; | ||
|
||
/** | ||
* -------------------------------------------------------------------------- | ||
* Cookie HTTPOnly | ||
* -------------------------------------------------------------------------- | ||
* | ||
* Cookie will only be accessible via HTTP(S) (no JavaScript). | ||
* | ||
* @var boolean | ||
*/ | ||
public $httponly = true; | ||
|
||
/** | ||
* -------------------------------------------------------------------------- | ||
* Cookie SameSite | ||
* -------------------------------------------------------------------------- | ||
* | ||
* Configure cookie SameSite setting. Allowed values are: | ||
* - None | ||
* - Lax | ||
* - Strict | ||
* - '' | ||
* | ||
* Alternatively, you can use the constant names: | ||
* - `Cookie::SAMESITE_NONE` | ||
* - `Cookie::SAMESITE_LAX` | ||
* - `Cookie::SAMESITE_STRICT` | ||
* | ||
* Defaults to `Lax` for compatibility with modern browsers. Setting `''` | ||
* (empty string) means default SameSite attribute set by browsers (`Lax`) | ||
* will be set on cookies. If set to `None`, `$secure` must also be set. | ||
* | ||
* @var string | ||
*/ | ||
public $samesite = 'Lax'; | ||
|
||
/** | ||
* -------------------------------------------------------------------------- | ||
* Cookie Raw | ||
* -------------------------------------------------------------------------- | ||
* | ||
* This flag allows setting a "raw" cookie, i.e., its name and value are | ||
* not URL encoded using `rawurlencode()`. | ||
* | ||
* If this is set to `true`, cookie names should be compliant of RFC 2616's | ||
* list of allowed characters. | ||
* | ||
* @var boolean | ||
* | ||
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes | ||
* @see https://tools.ietf.org/html/rfc2616#section-2.2 | ||
*/ | ||
public $raw = false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.