at path:
ROOT
/
wp-content
/
plugins
/
polylang
/
include
/
cookie.php
run:
R
W
Run
api.php
17.35 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
base.php
5.79 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
cache.php
2.44 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
class-polylang.php
8.55 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
cookie.php
3.35 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
crud-posts.php
15.17 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
crud-terms.php
9.87 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
db-tools.php
1.01 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
filter-rest-routes.php
4.87 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
filters-links.php
5.55 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
filters-sanitization.php
3.23 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
filters-widgets-options.php
2.57 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
filters.php
15.38 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
functions.php
7.01 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
language-deprecated.php
7.18 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
language-factory.php
9.31 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
language.php
18.04 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
license.php
9.19 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
links-abstract-domain.php
3.16 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
links-default.php
3.03 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
links-directory.php
9.49 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
links-domain.php
3.06 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
links-model.php
6.48 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
links-permalinks.php
5.62 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
links-subdomain.php
2.16 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
links.php
1.3 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
mo.php
1.97 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
model.php
33.84 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
nav-menu.php
4.43 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
olt-manager.php
8.37 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
query.php
6.39 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
rest-request.php
3.12 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
static-pages.php
6.26 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
switcher.php
10.89 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
translatable-object-with-types-interface.php
1.1 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
translatable-object-with-types-trait.php
1.89 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
translatable-object.php
13.27 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
translatable-objects.php
3.49 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
translate-option.php
12.46 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
translated-object.php
16.39 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
translated-post.php
11.68 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
translated-term.php
9.77 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
walker-dropdown.php
3.46 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
walker-list.php
2.25 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
walker.php
2.28 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
widget-calendar.php
9.44 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
widget-languages.php
4.57 KB
2026-06-16 01:07:17
R
W
Run
Delete
Rename
error_log
up
📄
cookie.php
Save
<?php /** * @package Polylang */ /** * A class to manage manage the language cookie * * @since 2.9 */ class PLL_Cookie { /** * Parses the cookie parameters. * * @since 2.9 * * @param array $args {@see PLL_Cookie::set()} * @return array */ protected static function parse_args( $args ) { /** * Filters the Polylang cookie duration. * * If a cookie duration of 0 is specified, a session cookie will be set. * If a negative cookie duration is specified, the cookie is removed. * /!\ This filter may be fired *before* the theme is loaded. * * @since 1.8 * * @param int $duration Cookie duration in seconds. */ $expiration = (int) apply_filters( 'pll_cookie_expiration', YEAR_IN_SECONDS ); $defaults = array( 'expires' => 0 !== $expiration ? time() + $expiration : 0, 'path' => COOKIEPATH, 'domain' => COOKIE_DOMAIN, // Cookie domain must be set to false for localhost (default value for `COOKIE_DOMAIN`) thanks to Stephen Harris. 'secure' => is_ssl(), 'httponly' => false, 'samesite' => 'Lax', ); $args = wp_parse_args( $args, $defaults ); /** * Filters the Polylang cookie arguments. * /!\ This filter may be fired *before* the theme is loaded. * * @since 3.6 * * @param array $args { * Optional. Array of arguments for setting the cookie. * * @type int $expires Cookie duration. * If a cookie duration of 0 is specified, a session cookie will be set. * If a negative cookie duration is specified, the cookie is removed. * @type string $path Cookie path. * @type string $domain Cookie domain. Must be set to false for localhost (default value for `COOKIE_DOMAIN`). * @type bool $secure Should the cookie be sent only over https? * @type bool $httponly Should the cookie be accessed only over http protocol?. * @type string $samesite Either 'Strict', 'Lax' or 'None'. * } */ return (array) apply_filters( 'pll_cookie_args', $args ); } /** * Sets the cookie. * * @since 2.9 * * @param string $lang Language cookie value. * @param array $args { * Optional. Array of arguments for setting the cookie. * * @type string $path Cookie path, defaults to COOKIEPATH. * @type string $domain Cookie domain, defaults to COOKIE_DOMAIN * @type bool $secure Should the cookie be sent only over https? * @type bool $httponly Should the cookie accessed only over http protocol? Defaults to false. * @type string $samesite Either 'Strict', 'Lax' or 'None', defaults to 'Lax'. * } * @return void */ public static function set( $lang, $args = array() ) { $args = self::parse_args( $args ); if ( ! headers_sent() && PLL_COOKIE !== false && self::get() !== $lang ) { if ( version_compare( PHP_VERSION, '7.3', '<' ) ) { $args['path'] .= '; SameSite=' . $args['samesite']; // Hack to set SameSite value in PHP < 7.3. Doesn't work with newer versions. setcookie( PLL_COOKIE, $lang, $args['expires'], $args['path'], $args['domain'], $args['secure'], $args['httponly'] ); } else { setcookie( PLL_COOKIE, $lang, $args ); } } } /** * Returns the language cookie value. * * @since 2.9 * * @return string */ public static function get() { return isset( $_COOKIE[ PLL_COOKIE ] ) ? sanitize_key( $_COOKIE[ PLL_COOKIE ] ) : ''; } }