1.3 to 1.4 upgrade issue with COOKIE_PREFIX

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
qbwdp
Posts: 6
Joined: Sat Apr 27, 2024 1:06 pm

1.3 to 1.4 upgrade issue with COOKIE_PREFIX

Post by qbwdp » Sat Jun 07, 2025 4:07 am

First i tried the upgrade, it gave same error, then I just tried the full brand new install of 1.4 and I am getting this error in my apache error log:

[Fri Jun 06 22:19:41.230701 2025] [php:error] [pid 211802:tid 211802] [client 1**.69.**.***:53120] PHP Fatal error: Uncaught Error: Undefined constant "COOKIE_PREFIX" in /var/www/********/fp-includes/core/core.cookie.php:13\nStack trace:\n#0 /var/www/***********/fp-includes/core/core.system.php(179): cookie_setup()\n#1 /var/www/***********/setup.php(7): system_init()\n#2 {main}\n thrown in /var/www/********/fp-includes/core/core.cookie.php on line 13

I get this when i hit setup.php page. I deleted the %%setup.lock when i was trying the upgrade. And for straight 1.4 install, i just unzip and try the setup. The permissions are all correct and owned by apache user.
I already cleared all cookies and tried chrome/firefox, same result.

I restored my old 1.3 site and it is working fine. Anytime i try upgrade or install 1.4 on the same old domainname as the old one, i get the above error.

# php --version
PHP 8.2.28 (cli) (built: Mar 13 2025 18:21:38) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.28, Copyright (c) Zend Technologies
with Zend OPcache v8.2.28, Copyright (c), by Zend Technologies

What's going on?

User avatar
fraenkiman
Posts: 368
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: 1.3 to 1.4 upgrade issue with COOKIE_PREFIX

Post by fraenkiman » Sat Jun 07, 2025 11:58 am

Hello qbwdp,

The actual cause of your error is probably not in the core.cookie.php file, but somewhere else:

Make sure that the function is_https() is available, as it is used to define COOKIE_PREFIX. If it does not exist, this will result in an error before define() is even executed.

The is_https() function is located in the defaults.php file.
Make sure that the configuration file is loaded before core.cookie.php.

The server configuration file is not part of the upgrade package or a new installation. This may be the problem.
Rename the .htaccess file as a test or move it to another directory.

Best regards
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

qbwdp
Posts: 6
Joined: Sat Apr 27, 2024 1:06 pm

Re: 1.3 to 1.4 upgrade issue with COOKIE_PREFIX

Post by qbwdp » Sat Jun 07, 2025 2:04 pm

OK, so i got the setup screen to come up now. I am doing the 13to14.zip upgrade.

deleted the old %%setup.lock. went to setup.php, it came up asked for uid/pass email, hit next and i get:

logo-small.gif FlatPress Setup

It just sits there. I do not see any "finished or done" remarks. I do see a file created in fp-content/%%setup.lock.

I go to login.php and to login and can't. My password did have @ in it. So, it seems I am stuck at this point. No errors in apache error log this time.


In a desperate attempt, I made fp-content 0777 and all the files as 777 also to see what might be stopping it. Still the install never tells me it is finished and after that I can't login.

qbwdp
Posts: 6
Joined: Sat Apr 27, 2024 1:06 pm

Re: 1.3 to 1.4 upgrade issue with COOKIE_PREFIX

Post by qbwdp » Sat Jun 07, 2025 2:59 pm

I did it the hard way. I used the 1.4 full install. created my admin user and it worked.

I just need to know what folders i need to copy over from my old site.

Currently i copied over:
fp-interface/themes
fp-content/content
fp-content/config/
fp-content/images

The site is working, is there anything I missed?

I can't click on Okay to get rid of this message on the bottom:

I use cookies, so that this website runs reliably and securely. Okay.

Where might this setting be?

qbwdp
Posts: 6
Joined: Sat Apr 27, 2024 1:06 pm

Re: 1.3 to 1.4 upgrade issue with COOKIE_PREFIX

Post by qbwdp » Sat Jun 07, 2025 3:26 pm

The cookie message was from a plugin called CookieBanner. I disabled it and the message went away.

User avatar
fraenkiman
Posts: 368
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: 1.3 to 1.4 upgrade issue with COOKIE_PREFIX

Post by fraenkiman » Sat Jun 07, 2025 4:09 pm

qbwdp wrote: Sat Jun 07, 2025 2:04 pm I go to login.php and to login and can't. My password did have @ in it. So, it seems I am stuck at this point. No errors in apache error log this time.
There will soon be an official bugfix release for this problem.
I have included the fix in this update package. -> 13to14fkm.zip
qbwdp wrote: Sat Jun 07, 2025 2:04 pm logo-small.gif FlatPress Setup
It just sits there. I do not see any "finished or done" remarks.
I can't get rid of the suspicion that your server configuration is faulty. Are you the master of the web server or are you using a provider's web server?
It sounds like your setup is simply rendering the header of the installation page (“logo-small.gif FlatPress Setup”), but cannot find or display the actual step templates (step1.php, step2.php, ...) or the associated CSS/JS or images.

It is possible that the setup (main.php) is denying you access because the file (0644) and directory rights (0755) are being pulled straight here.

I have changed this to 0666 and 0777 in my update package as a test, but this would be harmful if you are using a shared web host. Other users would then have access to your files.

Best regards
Frank
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

qbwdp
Posts: 6
Joined: Sat Apr 27, 2024 1:06 pm

Re: 1.3 to 1.4 upgrade issue with COOKIE_PREFIX

Post by qbwdp » Sat Jun 07, 2025 4:29 pm

Thank you for the reply and help fraekiman.

I am running all this on my own server, so all the setup is local. I can go through my apache/php site files again and see, but all worked fine with the full install of 1.4. I do have my wife's website that is still on 1.3 so i'll wait till the patched 13to14 comes out and i'll apply that there.

When you have time if you can see my post about the folders I copied over from 1.3 to 1.4. Did I miss anything?

Another side note, The Arvid video plugin was not working on 1.3. After the upgrade, it is working fine on 1.4.

User avatar
fraenkiman
Posts: 368
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: 1.3 to 1.4 upgrade issue with COOKIE_PREFIX

Post by fraenkiman » Sat Jun 07, 2025 4:35 pm

qbwdp wrote: Sat Jun 07, 2025 2:59 pm I just need to know what folders i need to copy over from my old site.

fp-interface/themes
fp-content/content
fp-content/config/
fp-content/images
I would not copy fp-content/config/ from your backup.
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

qbwdp
Posts: 6
Joined: Sat Apr 27, 2024 1:06 pm

Re: 1.3 to 1.4 upgrade issue with COOKIE_PREFIX

Post by qbwdp » Sat Jun 07, 2025 4:56 pm

OK, i'll unzip 1.4 and have look, compare files. But this was step #6 in 13to14 upgrade on the download page:

https://www.flatpress.org/download

6. The setup set your configuration to default values (see the blog title, the theme etc.). Restore your config by copying the fp-content/config/ folder from your backup to the server. Overwrite existing files.

And, i think this is where my site's look and theme setup is, right? I don't know, I've been updating phpbb, mediawiki, bookstack, textpattern, maybe I am confused and misreading the folders.

User avatar
fraenkiman
Posts: 368
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: 1.3 to 1.4 upgrade issue with COOKIE_PREFIX

Post by fraenkiman » Sat Jun 07, 2025 8:22 pm

qbwdp wrote: Sat Jun 07, 2025 4:56 pm The setup set your configuration to default values (see the blog title, the theme etc.). Restore your config by copying the fp-content/config/ folder from your backup to the server. Overwrite existing files.
I have therefore skipped copying the fp-content/config/ to ensure that FlatPress 1.4 works with the standard configuration after the update. If this is the case, you can copy fp-content/config/ and your own plugins as well.
:pencil: You are strong in PHP and Java Script? :point_right: Then help us to improve FlatPress. :point_left:

:exploding_head: Looking for ideas, templates, examples and answers to frequently asked questions?
:bulb: You'll find it here.

My :de: FlatPress-Blog: https://frank-web.dedyn.io

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests