XSS stands for cross-site-scripting. It allows you to run abitrary JavaScript code on the victim's website, not just for your browser, but for any browser. Usually this is done by refering someone to a link with the JavaScript code in it, but on forums it can be done by slipping in JavaScript into thread titles or posts.
I can use JavaScript to put your entire forum cookie into a variable, than redirect you to a website which will log that variable (aka, your cookie). Then I can just change my cookie's PHPSESSID (and other cookie variables) to yours. Then I will have hijacked your session and taken over your account.
I'm not sure if you are using
session_regenerate_id(), but if you aren't, you should use it. Wherever you use that function, the user's old PHPSESSID will be replaced with a new one, but it willl still save the session info from the old session. That way, you can prevent session hijacking.
As for blocking XSS, just filter out all your data using stuff like
htmlentities() or
strip_tags()