javascript - Cant destroy Cookies of Firefox in JAVA EE -
javascript - Cant destroy Cookies of Firefox in JAVA EE -
i have problem session cookie, when logout y destroy cookie, in chrome , ie, going well, cant destroy cookie in firefox, , if seek go site 1 time again after logout, allow me in.
im using struts 2, , have interceptor read cookies , creates or redirectme home page, depends if cookie exists or not.
also, when force button of firefox, action or interceptor not executed.
i need code, edit question
in java:
private deletecookie(string cookiename) { cookie[] cookies = reqest.getcookies(); if (cookies != null) { (cookie cookie : cookies) { if (long.valueof(cookie.getname()).equals(cookiename)) { cookie.setvalue(null); cookie.setmaxage(0); cookie.setpath(thesamepathasyouusedbeforeifany); response.addcookie(cookie); } } } }
and phone call
deletecookie("my_cookie_name");
in javascript:
in order delete cookie set expires date in past. function be.
var delete_cookie = function(name) { document.cookie = name + '=;expires=thu, 01 jan 1970 00:00:01 gmt;'; };
then delete cookie named my_cookie_name do.
delete_cookie('my_cookie_name');
the problem creating new cookie instead of getting existing cookies browser.
java javascript firefox cookies
Comments
Post a Comment