per vedere se la sessione è avviata fai
if(isset($_SESSION))
per settare un cookie usa setcookie()