ported & replaced the session system with the 0.8 version...
removed a potential security vuln
updated sql