Jump to content


Photo

cookie


  • Please log in to reply
2 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 14 August 2006 - 01:19 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 14 August 2006 - 01:39 PM

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
<?php
echo PHP_INT_MAX;
?>

it echo's PHP_INT_MAX...

Liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 14 August 2006 - 04:13 PM

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.

$expire = time() + (1000000*30);
setcookie("username", $username, $expire, "/administration/", ".funnyemailforwards.com",);
setcookie("password", $password, $expire, "/administration/", ".funnyemailforwards.com",);
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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users