added a cookie feature using Javascript