Persistent Cookies in Javascript/Jquery -


i trying create persistent cookie using javascript not sure how use domain attribute of document.cookie.

the domain working on development environment , can have special or encrypted characters (%sdf#ed). there no (.com) in url. example of domain/url: - http://networkportnumber/talkeasy/%sdf#ed/#1

so want create persistent cookie url contains word "talkeasy"

what have far

var d = new date(); d.settime(d.gettime() + (1*24*60*60*1000)); var expires = "expires="+d.toutcstring(); document.cookie = "tab=" + cookievalue + ";" + expires; 

use path when setting cookies. document.cookie = "username=john doe; expires=thu, 18 dec 2013 12:00:00 utc; path=/";


Comments