Northern Flame Posted December 28, 2007 Share Posted December 28, 2007 I am creating a membership program that gives you access to my entire website. the login script is located in a sub-directory though. I took this line of code from a article that someone told me to read: setcookie('username', $_POST['username'], time()+60*60*24*365, '/account', 'www.example.com'); if I want to give the user access to the entire website, should I change '/account' to '/' and also, I want the cookie to last 10 years, so should i make the time using method1 or method2 method1: time()+60*60*24*365*10 method2: time()+60*60*24*3650 Quote Link to comment https://forums.phpfreaks.com/topic/83441-solved-setcookie-apply-to-entire-website/ Share on other sites More sharing options...
rajivgonsalves Posted December 28, 2007 Share Posted December 28, 2007 Yes change account/ to /, your method of time looks correct Quote Link to comment https://forums.phpfreaks.com/topic/83441-solved-setcookie-apply-to-entire-website/#findComment-424507 Share on other sites More sharing options...
Northern Flame Posted December 28, 2007 Author Share Posted December 28, 2007 both methods or which one? thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/83441-solved-setcookie-apply-to-entire-website/#findComment-424508 Share on other sites More sharing options...
PHP_PhREEEk Posted December 28, 2007 Share Posted December 28, 2007 It's just math.. either will work = ) PhREEEk Quote Link to comment https://forums.phpfreaks.com/topic/83441-solved-setcookie-apply-to-entire-website/#findComment-424509 Share on other sites More sharing options...
Northern Flame Posted December 28, 2007 Author Share Posted December 28, 2007 lol true, thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/83441-solved-setcookie-apply-to-entire-website/#findComment-424510 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.