Jump to content

cookie


Ninjakreborn

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/17506-cookie/
Share on other sites

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.
Link to comment
https://forums.phpfreaks.com/topic/17506-cookie/#findComment-74563
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.