session_set_cookie_params();before calling
session_start();otherwise your session cookies will be sent in the clear.
session_set_cookie_params();before calling
session_start();otherwise your session cookies will be sent in the clear.
$topicid = (int)$listresult['topicid'];but I have changed it so now the value is assigned to a variable which is passed to the other function (so now not using the array as input)