I am having trouble figuring out how to create a javascript function that will destroy a php session. I have a clickable link that will call a function called destroyphpses
Everyone keeps saying AJAX. This would be a good idea if you want to clean up the cookie on the server side as well, but I think if you knew what AJAX was you probably would have used it already...
I found AJAX pretty confusing when I first came across it. So what I would suggest is having a look at and maybe using jQuery's AJAX functionality. Including jQuery for just one function is probably overkill, but it might be a bit easier.