Added test, added cookie func