handle 500 error correctly !
set maxAge for cookies