Oh. It is happening again today. I was logged into the mod portal on feb 1st but now today I'm logged out and the search won't function. what info you need from me to look into it? I'll keep the cookies around this time and won't resign in either.
[edit]
Looking at the private window where searching works without logging in and the "public" window where the search broke there is an extra cookie for "mods.factorio.com" for the "public" window. Both windows also have a cookie for "*.factorio.com"
Signing into the private window doesn't create a "mods.factorio.com" cookie.
[edit2]
If I copy the search url
https://mods.factorio.com/query/space?version=1.1 from the private window and paste it into the public/broken window the search loads but if I use the search box to search something else I get returned to
https://mods.factorio.com/?version=1.1
[edit3]
Looking at the http traffic a search for "space" on the public/broken window sends a post request to
https://mods.factorio.com/?version=1.1 which returns a http 200 code.
Doing the same on the private window sends a post request to
https://mods.factorio.com/?version=1.1 which returns a http 302 code and redirects to
https://mods.factorio.com/query/space?version=1.1
Looks like for some reason the bad cookie is causing the 302 redirect to not happen?
[edit4]
More poking around the tabs "recent/downloaded/trending/popular" are remembered with the broken search and so are the category and version buttons. It just seems like the 302 http redirect just doesn't happen if the bad cookie is present.
Out of curiosity why is the query posted, processed then redirected with a http header and turned into a get request? Why not use a little javascript on the browser side to generate the get result directly?
[edit5]
I've been able to replicate this bug easily now. Just go to
http://mods.factorio.com then use your browser's console to delete all the cookies for *.factorio.com and mods.factorio.com
Once that is done try searching and it will fail.
Seems like if whatever cookie is being checked for is either missing or in a bad state (as in previous valid login is now expired) then the search will fail. And in the case of the "bad" cookie it will never get fixed until you sign back in again or manually delete the cookie. If you are logged in and logout then you won't end up in a "bad" cookie state.
Still can't wrap my head around why the way the search is programmed this way and now I'm even more confused on why it relies on a cookie to even function.
[edit6]
Another thing possibly unrelated to the mod portal's login but the CSRF token for the
https://factorio.com/login page doesn't always get added/created so I have to sign-in twice since the first time I get a missing CSRF token error.
