Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cachify.hdd.htaccess.php - should generate right variables #271

Open
1ucay opened this issue Aug 4, 2022 · 1 comment
Open

cachify.hdd.htaccess.php - should generate right variables #271

1ucay opened this issue Aug 4, 2022 · 1 comment
Labels

Comments

@1ucay
Copy link

1ucay commented Aug 4, 2022

Hello, thank you for you work.

In wp-config.php I have some personal changes

define( 'WP_DEFAULT_THEME', 'custom' );
define( 'ADMIN_COOKIE_PATH', '/admin' ); /*Im using /admin url */
define( 'SITECOOKIEPATH', '/' );
define( 'TEST_COOKIE', WP_DEFAULT_THEME . '_test' );
define( 'LOGGED_IN_COOKIE', WP_DEFAULT_THEME . '_logged_RANDOM' );
define( 'SECURE_AUTH_COOKIE', WP_DEFAULT_THEME . '_sec_RANDOM' );
define( 'AUTH_COOKIE', WP_DEFAULT_THEME . '_RANDOM' );
define( 'PASS_COOKIE', WP_DEFAULT_THEME . 'pass_RANDOM' );
define( 'USER_COOKIE', WP_DEFAULT_THEME . 'user_RANDOM' );
define( 'RECOVERY_MODE_COOKIE', WP_DEFAULT_THEME . '_rec_RANDOM' );
/* RANDOM is hash */

Also I have
define( 'WP_CONTENT_DIR', WEB_ROOT . '/app' );

So these lines

RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-content/cache)/.*
RewriteCond %{HTTP_COOKIE} !(wp-postpass|wordpress_logged_in|comment_author)_

Shoul be generated over LOGGED_IN_COOKIE, admin_url(), WP_CONTENT_DIR

Thank you.

@Zodiac1978 Zodiac1978 added the bug label Aug 14, 2022
@1ucay
Copy link
Author

1ucay commented May 28, 2024

also there should be LOGGED_IN_COOKIE

private static function _is_logged_in() {
	/* Logged in */
	if ( is_user_logged_in() ) {
		return true;
	}

	/* Cookie? */
	if ( empty( $_COOKIE ) ) {
		return false;
	}

	/* Loop */
	foreach ( $_COOKIE as $k => $v ) {
		if ( preg_match( '/^(wp-postpass|wordpress_logged_in|comment_author)_/', $k ) ) {
			return true;
		}
	}

	return false;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants