try cookies and sessions in javascript