Ninjakreborn Posted August 14, 2006 Share Posted August 14, 2006 setcookie("username", $username, PHP_INT_MAX);setcookie("password", $password, PHP_INT_MAX);those are returning errors and they were not before. I am using cookies instead of sessions for 2 reasons, it's simply for 1 persons admin page, he wanted cookies, and i don't have php.ini access. It use to accept that last parameter, to make it a permanent cookie, but now it's not. Quote Link to comment https://forums.phpfreaks.com/topic/17506-cookie/ Share on other sites More sharing options...
shocker-z Posted August 14, 2006 Share Posted August 14, 2006 I get the same error "Warning: setcookie() expects parameter 3 to be long, string given in /var/www/phpfreaks/cookies.php on line 2"is it running above PHP 4.4.0?as mine isnt and when i do<?phpecho PHP_INT_MAX;?>it echo's PHP_INT_MAX...Liam Quote Link to comment https://forums.phpfreaks.com/topic/17506-cookie/#findComment-74465 Share on other sites More sharing options...
Ninjakreborn Posted August 14, 2006 Author Share Posted August 14, 2006 I said to hell with it, it worked, then a few months later it stops working. Server's were changes, so I got tired of it, I learnt a few new techniques about setting the domain name so I set that up this time, and changed that around and it works. I think the php max int has something to do with the way php.ini is set, with that being the case, It is not something that is very safe. ESPECIALLY if you are trying to write code that can go from server to server. I have to figure out something.[code]$expire = time() + (1000000*30);setcookie("username", $username, $expire, "/administration/", ".funnyemailforwards.com",);setcookie("password", $password, $expire, "/administration/", ".funnyemailforwards.com",);[/code]Actually you can even take that 1 million mark and change that to 2-5 million or somethign I am unsure how much time that is, but it'll probably last quite a bit of the average humans lifespan, it's a simpler way to do it. Quote Link to comment https://forums.phpfreaks.com/topic/17506-cookie/#findComment-74563 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.