> Do you mean that you have another seperate include file contains
> some funtions from main.inc.php just for your own scripts?
There's no need to include the whole main.inc.php file. I've used only the authenticate function which basically selects a record (from the w3t database) that matches the specified username/pass (which in turn is fetched from cookies). If the user exists, the extra fields that I'm interested in are passed back so the calling script gets it.
As for the cookies: setcookie("w3t_myname","$CheckUser",time()+31536000,"",".domain.ro");
The empty parameter is the path, and the ".domain.ro" is the domain. Thus, if a.domain.ro sets the cookie, b.domain.ro will receive it too.
Unfortunately "domain.ro" cannot receive the cookie since there is a limitation that is enforced on all tlds (except for .com, .net, .org, .mil, .gov, .edu) regarding the minimum number of dots that are allowed when setting a cookie on a domain. Anyway, what's important for you is that for the above tlds you can set a cookie without the leading dot (as in my example) and have it working both on "domain.tld" and "host.domain.tld".