MyBB Community Forums

Full Version: Cookie Problems - Not saving cookie path? [NOT SOLVED]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2011-07-22, 09:24 PM)MattRogowski Wrote: [ -> ]If it's still showing the old settings (in the HTML source of a page) even after editing settings.php then you're not saving the file properly.
This makes a lot of sense, but I don't know how it could be saving incorrectly. This is my process:

-Download inc/settings.php from FTP onto local drive.
-Open settings.php
-Replace Board URL, Cookie Domain, and Cookie Path manually.
-Save
-Upload newly saved file to FTP
-Click to Overwrite existing file with new one.
-Log in on forums
-Wait to be redirected
-Home page says I'm not logged in.
-Re-download inc/settings.php onto local drive
-Opening shows that any changes I made before I uploaded it to the FTP have reverted back.

It seems like the forums are rewriting the inc/settings.php with the previous data even after I manually update it.
It will only rewrite it if you tell it to, by saving the settings in the ACP, or if the settings file doesn't exist or is empty. After you've edited, saved and reuploaded the files, have a look at the page source of your forum (Ctrl + U or View > View Source or something like that depending on your browser) and near the top you'll see this:

<script type="text/javascript" src="http://www.metaldrift.tv/tempforum/jscripts/prototype.js?ver=1603"></script>
<script type="text/javascript" src="http://www.metaldrift.tv/tempforum/jscripts/general.js?ver=1603"></script>
<script type="text/javascript" src="http://www.metaldrift.tv/tempforum/jscripts/popup_menu.js?ver=1600"></script>
<script type="text/javascript" src="http://www.metaldrift.tv/tempforum/jscripts/thumbspostrating.js?ver=1600"></script><link type="text/css" rel="stylesheet" href="http://www.metaldrift.tv/tempforum/css/thumbspostrating.css" /><link type="text/css" rel="stylesheet" href="http://www.metaldrift.tv/tempforum/cache/themes/theme4/global.css" />

<script type="text/javascript">
<!--
	var cookieDomain = ".metaldrift.tv";
	var cookiePath = "/tempforum/";
	var cookiePrefix = "";
	var deleteevent_confirm = "Are you sure you want to delete this event?";
	var removeattach_confirm = "Are you sure you want to remove the selected attachment from this post?";
	var loading_text = 'Loading. <br />Please Wait..';
	var saving_changes = 'Saving changes..';
	var use_xmlhttprequest = "1";
	var my_post_key = "75484cb2933f6ccecdfb8f04da9f9be9";
	var imagepath = "images";
// -->
</script>

The URLs here and the cookie settings in the javascript are the values being taken directly from settings.php, so if you edit, save and upload the file, then view the source, and it still has the old ones (make sure you refresh the page before checking) then something weird is going on with saving the actual file.

If this still doesn't work, then try this. Run the following queries in phpMyAdmin:

UPDATE `mybb_settings` SET `value` = '.blackjacketstudios.com' WHERE `name` = 'cookiedomain';
UPDATE `mybb_settings` SET `value` = '/forum/' WHERE `name` = 'cookiepath';
UPDATE `mybb_settings` SET `value` = 'http://www.blackjacketstudios.com/forum' WHERE `name` = 'bburl';

After this, just delete settings.php completely and it should rebuild itself with the new settings.
Matt, I got the users FTP and Admin details, and edited settings.php with the new settings, but as soon as I load any page on the forum, the settings revert back to the old cookie settings. The user was doing everything correctly, but something is making the settings revert.

Just run the queries Matt posted and follow the instructions below them. Smile
There must be something different about this forum then, it won't do that for no reason or by itself.
Pages: 1 2