>> I want to modify oscommerce according to my theme. Is it legel?
It's an open source package so you are welcome to modify it for your use. As for the session ID, I'd suggest you visit the osCommerce forums and do a bit of searching there. I think they've covered the subject. If you don't find anything, post your question there. Not that you're not welcome to post here but rather that you're more likely to get an answer there. :)