you can redirect to
www.domain.com from domain.com using various methods. If you have access tot he web server configuration and
mod_rewrite is avaible, you can accomplish it rather easily without having to code anything. The server itselt maintains the rules.
if you're web app needs any time of cookie based information (session tracking for instance), it will save a lot of headaches if you only allow access to your web app through one domain.