I have a php file that uses jquery. I have this file store cookies if a check box is checked after the submit button is pressed and delete the cookies (if they exist) if the checkbox is not checked.
It works perfectly fine on my development server, which does not have symfony on it. When I transfer it over to our live server, which requires me to place the code in symfony, it saves the cookies but it does not delete them. I am using the jquery.cookies.js from here LINK
and my code is simply
// else delete the cookies if the checkbox is unchecked
else
{
?>
<script type="text/javascript">
$.removeCookie('vtuid');
$.removeCookie('vt_usr');
$.removeCookie('vt_pd');
$.removeCookie('vt_chk');
</script>
<?php
}
B default symfony set cookie with flag http only, that mean – you can`t delete cookie from js.
for example: