No, it's still not clear to me. Only you know what you're talking about as to stdClass object, saveBookmark, etc. since it's unique to your code.
What I can share is that there is no point of passing the session id like that unless you are specifically looking for it in $_GET['sid']. PHP's default session name is PHPSESSID (unless you changed it to use "sid").
If a user has allowed cookies, then a session cookie will be created and the PHP "SID" constant will be blank/null. When a session cookie can't be created, PHP sets the "SID" constant to contain the session name and ID. Also, if you have "session.use_trans_sid" php.ini setting on, PHP will put the session name and ID in all your links automatically (so the session won't get dropped/lost). So, on redirects like you're doing with the header() location, you should add the SID constant in the URL like so:
header('Location: ' . $_SERVER['HTTP_REFERER'] . '?' . SID);
exit;
This is only really needed for user's who don't get a session cookie created, but since PHP will assign the SID null when a session cookie is created, then it can be used in this fasion without the need for any condition checking.
.