Sometimes if I visit this URL: aoba-metro.org/forum
It forwards me to:
http://www.aoba-metro.org/forum/index.php?PHPSESSID=4d95f4545a37875af7812a46298d9fb1;www
Which then produces a 404 error. However, when I then visit the same URL again... it suddenly works. I believe it's some sort of cookie issue.
Is there a way to fix this / does anyone know why that happens?
You might want to try going to Admin>Server Settings>Feature config> and enable local storage of cookies. or if it is enabled try disabling it. Tell us how that works for you.
OK, I tried that, but it doesn't seem to have made a difference. Could it be a stored cookie/session issue? How can I clear all stored cookies/sessions?
Give us a clue, here...
What browser do you use?
Ah, to clarify: It is not a browser-dependent thing. (I know how to clear cookies within the browser). It happens on any browser, on any machine. Firefox on Linux, Firefox on Mac, Safari on Mac.
Is there a way to clear the *server side* storage of cookies/sessions, so that I can determine if it's just some sort of corrupted session thing?
You could always rename the cookie...
Kat:
Read the rest of the thread. It's not an issue with a cookie on my computer, and I don't know where the database sessions/cookie data is stored on the server. So, how am I supposed to rename it?
The whole issue is that it redirects my incorrectly when I visit the forum initially, but then works correctly thereafter. Do you have any idea why this would happen?
Admin>server settings>Cookie Name
Try making it "SMFCookie10", or something.
Hrm, nope, that doesn't seem to make a difference.
Would SMF be doing the redirecting from aoba-metro.org to www.aoba-metro.org, or maybe that's an Apache thing...?
I found the answer! Or at least part of it, and a fix!
In Sources/Load.php, line 1229-ish in SMF 1.1.7 looks like this:
// Hmm... check #2 - is it just different by a www? Send them to the correct place!!
if (empty($do_fix) && strtr($detected_url, array('://' => '://www.')) == $boardurl && (empty($_GET) || count($_GET) == 1))
{
// Okay, this seems weird, but we don't want an endless loop - this will make $_GET not empty ;).
if (empty($_GET))
redirectexit('www');
else
{
list ($k, $v) = each($_GET);
if ($k != 'www')
redirectexit('www;' . $k . '=' . $v);
}
}
That chunk of code causes the forum to redirect to an incorrect URL if you visit it from aoba-metro.org/forum because the forum is configured as www.aoba-metro.org/forum. This is a *bug* in SMF as far as I'm concerned. I want my forum accessible from either www.aoba-metro.org/forum *OR* aoba-metro.org/forum, and I don't want it to redirect my users if they visit it from one URL or the other.
I commented out those lines and it fixed the problem.
There must be something wrong with the redirect as I get http://www.mysite.com/index.php?PHPSESSID=26b0e401608d7f52617e1c3397b2ca83;wwwRedirect
Note the added Redirect after www.
Weird. Same version of SMF? 1.1.7? Maybe it's been fixed in other versions.
If this is solved please mark it solved by clicking the Mark Topic Solved link at the bottom left of the page.