Collecting the session IDs is not illegal, but yes, using them would be.
(but of course courts have sent people to jail for much less...)
(but of course courts have sent people to jail for much less...)
At any rate, it certainly doesn't seem correct to say "it isn't illegal" as a blanket statement.
I would agree that collecting session ids on systems that you do not own or have legitimate access to is almost certainly illegal.