Before getting hacked, what version of SMF where you using?
The attacker would have to know your session id in order to try and exploit it, but this issue was resolved in 1.1.3. In order for him or her to know it, they would need to have either database access, in which case it wouldn't even be needed, or they would trick you into following a link to their site that contained the session id so they could steal it from you.