MyBB Community Forums

Full Version: How to fix cookies with new domain?(Very Important)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

I have a problem about cookies in my website

I changed my domain from pasargad3.tk to pasargad3.in after that my host's support send a message to me and they said I have to change my host company too.

After restoring the Full backup of my website I changed all domain was in file setting.php in inc folder in my host to new domain and I tried to Entry with my Account in my website after the message said You Successfully entered I see I didn't enter and page is like guest for me

what can I do for this problem?
Open your database, go to table PREFIXsettings. There you find the entrys "cookiedomain" and "cookiepath". Update your data there too.
Sorry but there isn't any setting about "cookiedomain" and "cookiepath"

Are you sure about it?
Are you sure it logs you out? If yes, try with another browser, the cookie settings in page source seem to be correct:
var cookieDomain = ".pasargad3.in";
var cookiePath = "/";
var cookiePrefix = "";
Also provide a test account.

There seems to be HTML mistake somewhere in template (most likely headerinclude) though, because headerinclude is loaded inside <body> for some reason.
$settings['cookiedomain'] = ".pasargad3.in";
$settings['cookiepath'] = "/";
$settings['cookieprefix'] = "";

The code Is above It's correct,isn't it?

I cant access to headerincludetemplate to make any change
^ suggested settings are correct and they should be in ./inc/settings.php file

headerinclude template consists of code like below
<script type="text/javascript">
<!--
	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var cookiePrefix = "{$mybb->settings['cookieprefix']}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
	var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
	var my_post_key = "{$mybb->post_code}";
	var imagepath = "{$theme['imgdir']}";
 // -->
</script>

you have already posted at Login/logout problems thread. you can strictly follow that guidance
first change the cookie settings in the settings.php file then you should be able to log into admin panel.
then again change the cookie settings at General Configuration settings of admin panel
I can enter to Admin CP successful but when I click on every setting I will kick out

Is there any other way to change headerinclude without Admin CP?

If you try to register in my web site and you'll see It's problem

the base language is Persian you can change it
Login/Logout problems? PLEASE READ THIS ---> http://community.mybb.com/thread-42123.html
I did that my friend but not worked
If you cannot work out your cookie settings, you can use this cookie generator http://www.dennistt.net/mybb/cookiesettings.php and it will attempt to give you the correct settings. It is also recommended that you do not change your cookie settings when you install your forum as they are usually correct in the installer.

You can view your current cookie settings by viewing the source code from a page of your forum. If your cookie settings are wrong, you probably won't be able to change them in the ACP as you may not be able to stay logged in. If this is the case, in order to change them, find a way to open and edit ./inc/settings.php and edit the new values into the file. Then, you MUST go to 'ACP > Configuration > General Configuration' and make the change here too. This is because although editing the file will make you able to log in, the settings aren't updated in the database, and when you next save any settings in the ACP, the old settings will come back.

hope that helps