Probable fix for signed cookie problem, and potential avenue for vast simplification of code