Da sid'en kan udløbe må det jo havde noget med denne her at gøre
<?
/* this is a simple function that adds the users sid to a url, it's based on the function that phpBB forums acctually use */
function add_sid($url){
/* sets some variables to current sessions name and id */
$s_name = session_name();
$s_id = session_id();
$sid = $s_name."=".$s_id;
if(!defined('LOGGED')){
/* regular url used if the user is not logged in */
return $url;
}else{
/* checks to see if the url already contains the session's variable */
if(preg_match("#$s_name=#", $url)){
/* if it does, return the url */
return $url;
}
/* this is used if the url doesn't have the proper variable, and the user is logged in
it formats the url using something similar to an if statement
visit
http://php.net/manual/en/language.expressions.php for more info */
$url .= ((strpos($url, '?') !== false) ? '&' : '?') . $sid;
/* returns the properly formated url */
return $url;
}
}
?>