Backport of  #3985 (Invalid remember me token)

This should fix #854 in OC5