MyBB Community Forums

Full Version: Changing board URL/board cookie settings
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Ideally this info should not be in the database and keep overwriting the settings.php file because it's impossible to remain logged in when changing the cookie domain or the main board URL.

I had transferred my database from http://localhost to http://mydomain and I couldn't stay logged in at all to achieve this change. Finally had to manually go into phpMyAdmin and modify it.

Please keep these crucial settings in the text file and not allow it to get overwritten by the database.
What?? You just edit the file to make these changes if you need to, that's the way to solve wrong cookie settings. They have to be kept in the database, otherwise if you delete the settings file, you're going to lose all your settings forever aren't you. If you changed the cookie settings in the ACP before you moved your files, the problem wouldn't have occurred. When you save settings they're saved to the database that then regenerates settings.php, and the forum uses what's in settings.php
Ya, for some reason I'm not able to log in at all now. Something screwed up with the localdomain/localhost etc.

Whenever I changed the settings.php file, it kept getting back to the old state after logging in to the admin panel.

I wish I had thought of the board URL / cookie domain etc. before I moved the board to the live server, but now I'm stuck at this point.

I'm not able to log in or fix the problem. Even after changing the database directly I am unable to log in at all.
If you edit settings.php to the correct settings, then make them again in the ACP straight after, it should be fine. What is your actual URL??
(2010-01-28, 08:40 AM)MattRogowski Wrote: [ -> ]If you edit settings.php to the correct settings, then make them again in the ACP straight after, it should be fine. What is your actual URL??

This is what I tried first. What happened was this.

I successfully managed to log in to the admin panel.

When I went to preferences, changed the settings and clicked on the save button, it dumped me back to the login screen and I was unable to change anything.

It seems to go in a circular loop now. Sad

My URL is http://toonsandcomics.net where I installed my forum. Originally created in localhost.
Finally fixed it.

I first deleted settings.php and then went to phpMyAdmin to modify cookie domain and cookie path.

That has done it for me.

Actually I think it's a bad idea to rely on the database because it's precisely a situation like this which can screw up the login system and it's easier to edit a PHP file to fix it rather than go through phpMyAdmin.

Thanks anyhow for pointing me in the right direction.
(2010-01-28, 08:42 AM)harishankar Wrote: [ -> ]Actually I think it's a bad idea to rely on the database because it's precisely a situation like this which can screw up the login system and it's easier to edit a PHP file to fix it rather than go through phpMyAdmin.

That is how you solve this issue. The forum uses whatever is in the file, so if you edited the file and it didn't log you in, the settings you put in wouldn't have been right. It doesn't directly read the database when checking settings.

Your settings still aren't quite right, you need a . at the start of the cookie domain and you probably don't need a cookie prefix.
OK thanks a lot. I'll fix it. But how come the settings.php file reverted to the old settings? When does it revert back to the old settings and why?

That was what confused me. Before I could change it in the admin panel, it went back to the old (bad) settings and I wasn't able to log in properly. I tried your method four or five times before giving up and editing the database with phpMyAdmin directly.