hackalive Posted April 8, 2012 Share Posted April 8, 2012 Ive put together a PHP/MySQLi login script for my site. However I was wandering: 1. Does Facebook use PHP Cookies or Sessions for their login? (Figured out my own answer ) 2. How does FB set the Cookie/Session so that when I log into facebook.com I am also logged into developers.facebook.com Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/260562-login-authentication/ Share on other sites More sharing options...
dcro2 Posted April 8, 2012 Share Posted April 8, 2012 If you assign a cookie with the domain .domain.com (or just domain.com) it should be sent to any subdomain as well. Just make sure to set the path as / or something that fits all subdomains you want. See session_set_cookie_params. Link to comment https://forums.phpfreaks.com/topic/260562-login-authentication/#findComment-1335382 Share on other sites More sharing options...
hackalive Posted April 8, 2012 Author Share Posted April 8, 2012 So when setting the cookie id set it as ".mydomain.com" or "/"? Link to comment https://forums.phpfreaks.com/topic/260562-login-authentication/#findComment-1335383 Share on other sites More sharing options...
dcro2 Posted April 8, 2012 Share Posted April 8, 2012 A cookie has both a domain and a path. If you set a cookie's domain to "domain.com", you will also see it on "sub.domain.com" but only if its path matches the URL. So set the domain as ".mydomain.com" and the path as "/", which means any path on any subdomain. They're two different things that work together. Link to comment https://forums.phpfreaks.com/topic/260562-login-authentication/#findComment-1335384 Share on other sites More sharing options...
hackalive Posted April 8, 2012 Author Share Posted April 8, 2012 okay, many thanks Link to comment https://forums.phpfreaks.com/topic/260562-login-authentication/#findComment-1335385 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.