It depends on your script..Example: on lavalair login.php
mysql_query("INSERT INTO ibwf_sessions SET id='".session_id()."' WHERE uid='".getuid_nick($_GET['loguid'])."', expiretm='".(time() + (24*60*60))."'");
you then inserted it into the database..Then in every top of a file like index.php..assign session_id() to $sid..
$sid = session_id();
now, it will work..this will return your membership id..
$uid = getuid_sid($sid);
just analyze..this one is the link to your profile..
index.php?action=viewuser&who=$uid
and then this, on logout
index.php?action=logout&who=$uid
got my point?the thing i can tell you about this is to be wise 'cause they might abuse it by putting that url in an image source..once you executed that image with that url, example, the source is the logout url, then you will be logged out..