I want to delete the cookie that I set. If I do this by giving him an expiration date in the past, he will be marked as “expires: at the end of the session”. I noticed that other sites manage to delete cookies as soon as possible. For example, when you log out on stackoverflow, the user's cookie disappears immediately. How?
You cannot influence how and when the browser destroys expired cookies.
I assume that here on SO after logging out, a redirect is issued, so the browser gets the option to delete the cookie right now.
javascript, cookie, ( , javascript)
jquery.cookie.js .
<script type="text/javascript" src="jquery.cookie.js" ></script> <script type="text/javascript"> var myCookie= readCookie('myCookie'); if (!!myCookie) {eraseCookie('myCookie');} </script>
, , , javascript.
Source: https://habr.com/ru/post/1721269/More articles:Exception when IsOneWay True - wcfDefine a newline return method in PHP - phpSimulator for BlackBerry 9300 - mobileA common function in a list of a derived class is listCan I pass a table as a parameter when running a stored program? - sqlMy cgi script cannot write to the api cgi-bin folder - apacheUse javascript and php through ajax to run MySQL queries - javascriptTransactional Services => BeanNotOfRequiredTypeException, there should be advice, but TransactionInterceptor - javaКак отобразить полосу ширины 100% в дизайне CSS с использованием чертежа с фиксированной сеткой? - htmlhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1721274/transactionproxyfactorybean-when-switching-from-configuration-based-service-beans-to-annotation-based-service-beans&usg=ALkJrhia_2hfrTkbj4VTw5vCoWvEIi6BkwAll Articles