# Problem removing session cookie

**URL:** <https://forum.kirupa.com/t/problem-removing-session-cookie/326242>\
**Category:** programming\
**Created:** [December 1, 2011, 12:56pm UTC](https://forum.kirupa.com/t/problem-removing-session-cookie/326242 "2011-12-01T12:56:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerome\_chevreau](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jerome\_chevreau](https://forum.kirupa.com/u/jerome_chevreau)\
**Post date:** [December 1, 2011, 12:56pm UTC](https://forum.kirupa.com/t/problem-removing-session-cookie/326242/1 "2011-12-01T12:56:46Z")

</div>

Hi there,

I am trying to counter a session hijack example.

I log in with my chrome browser and with the use of js i set my cookie (in firefox) to be the same as the one in chrome. i am able to login automatically (as my session id are stored in db).

I have a validation which then check if i am coming from the right “user agent”. obviously now being in firefox i get kicked out but my cookie does not get removed.

Using an alert in js “document.cookie” i have the same cookie twice with different values. I cannot delete entirely the cookie until i clear my browser cookie.

i tries unser the cookie name and also setcoookie(name,’’, 1 yr old). nothing.  
how can i completly cleat the whole cookie.

Thanks for any help,
