cookies in node
refactoring for all usecases