MyBB Community Forums

Full Version: How to really clean cookies?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
az0000000 Wrote:Now I can see I should tell you that I am on RC4 now
Oh... right, I forgot about that. Sad

Quote:So, I am not sure that password remove option is available in my version.
I checked the code, and it's not there.

Quote:I have checked and no such option, but I’d really need to have it. Can I create that by my self? Is it possible?
Yes, I think it's possible to add the feature with a simple modification. What if the "Clear Cookies" function was modified to delete all forum password cookies? Would that work?
WDZ Wrote:Yes, I think it's possible to add the feature with a simple modification. What if the "Clear Cookies" function was modified to delete all forum password cookies? Would that work?
It might really work. Unfortunately I am not so good in coding [not at all]
Could you please help me test that? I'd deeply appreciate your help.
OK, I think one simple modification of misc.php is all you need. Smile

Find this code...
	redirect("index.php", $lang->redirect_cookiescleared);
Add this code right above that...
	if(isset($_COOKIE['forumpass']) && is_array($_COOKIE['forumpass'])) {
		foreach(array_keys($_COOKIE['forumpass']) as $fid) {
			mysetcookie("forumpass[".intval($fid)."]", "");
		}
	}
That new code will simply unset any forumpass cookies that are currently set.
WDZ Wrote:OK, I think one simple modification of misc.php is all you need. Smile
Do i have to modify misc.php from main directory or the one from admin folder?
The main directory.

That is where the "clear cookies" function resides, after all. Smile
Also, afterward how do i call this function from browser?
Thanks a lot.
az0000000 Wrote:Wow! It worked! I just run this regular action http://moldova.worldcarp.org/forum/misc....earcookies and all password are deleted.
Great. Smile

Quote:Just a bit modification is needed if you don’t mind. When I run the function I am redirected to blank page.
That's strange, because it should redirect you to index.php. Did you accidentally remove this line of code?
redirect("index.php", $lang->redirect_cookiescleared);
WDZ Wrote:Did you accidentally remove this line of code?
redirect("index.php", $lang->redirect_cookiescleared);
Oh, my apology, that is exactly what i have done instead of adding the code you supplied above this line. See, i am not a programmer Shy
Changing now Smile
Pages: 1 2 3