PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi everyone. Im using an invision forum on my website, and i want to make it so when your logged in on the forum, your logged in on the website. Ive made it so my registration and everything uses the same table/database, and ive got all that, what my problem is invision used cookies to store login info. So i did some searching and pulled up the cookie that stores the info, and made this:
it didnt reconize that the cookie was set, so i scratched my head for a few seconds, and realized that the cookie was set for forums.mydomain.com, not mydomain.com, wich is were the site is. Is there anyway to get around this? Am I wrong and this is not the problem?
To make the cookie available on all subdomains of example.com then you'd set it to '.example.com'. The . is not required but makes it compatible with more browsers. Setting it to http://www.example.com will make the cookie only available in the www subdomain. Refer to tail matching in the spec for details.
Ok, thank you, i know now that the cookie isnt being set for all domains. I found out that they are setting the cookie through Javascript, i modifed it to this:
document.cookie = ipb_var_cookieid + name + "=" + value + "; expire=" + expire + "; domain=.ne0.fgvhost.net;"
then, i did a simple test to see if that worked. It sais "NOT SET!", i moved the file that im working on into the forums subdomain, ran it, and it printed "HEY" and the value of the cookie.
i made some progress...but now im stuck. how can i get it to set the cookie for all domains?
i dont know? ask the people who wrote ipb 2.0, im just trying to get it so when your logged in on the forum your logged in on the site and vis versa. i dont want to mess with things to badly, because im afraid i might mess something up. i guess i will try using setcookie() now, but im going to have to modify alot of things
i guess u could just use setcookie() from php, since later on i do not think that the script will make any destinct wether the cookie has been set with java or php ...