I'm not so sure I can identify what the problem is but the $session->logged_in doesn't make much sense if you haven't declared $session somewhere to be a new type of object. Unless you're trying to refer to the session superglobal array somehow, but for PHP 5 that would be of the sort
$_SESSION, and you'd have to test that it's set or something. Not exactly sure what you're going for.
Furthermore I think javascript is unnecessary in what you're trying to achieve. If you're already using javascript might as well just do everything with it. In other words the use of the form isn't exactly necessary. To stick with PHP I would suggest using 3 radio buttons something of the form:
<input type="radio" name="type" value="delete"> Delete
<input type="radio" name="type" value="edit"> Edit
<input type="radio" name="type" value="share"> Share
Then it just becomes a matter of checking
$_POST['type'] for the given operation you wish performed. Could even do it with numbers rather than strings:
<input type="radio" name="type" value="0"> Delete
<input type="radio" name="type" value="1"> Edit
<input type="radio" name="type" value="2"> Share
This would allow you to perform a switch statement for each particular case:
switch((int)$_POST['type']){
case 0: ... // Delete code
case 1: ... // Edit code
case 2: ... // Share code
default: ... // In case of an error
} I don't know that these suggestions actually help the problem you're currently experiencing which seems to be more of a session problem than it does a javascript or php error.