Jump to content

Setcookie error


nawad24

Recommended Posts

I am getting this error on our website and have no clue how to fix it.  Any help would be very much appreciated!

 

Warning: setcookie() expects parameter 3 to be long, string given in /home/cust1/usr1127/html/management/lib/session/session.lib on line 50

 

this is line 50:

 

 

function storeNewCookie($session_id) {

setcookie ($this->cookie_name, $session_id, $this->cookie_expire_length);

}

Link to comment
https://forums.phpfreaks.com/topic/67301-setcookie-error/
Share on other sites

do  var_dump

function storeNewCookie($session_id)
{
      var_dump($this->cookie_expire_length);
      die;
      setcookie ($this->cookie_name, $session_id, $this->cookie_expire_length);
   }

 

see whats returned..

 

this may fix it (its a total guess)

function storeNewCookie($session_id)
{
      $x = (int)$this->cookie_expire_length;
      $x = time()+$x;
      setcookie ($this->cookie_name, $session_id, $x);
   }

 

 

Link to comment
https://forums.phpfreaks.com/topic/67301-setcookie-error/#findComment-337668
Share on other sites

thanks!  the error message no longer appears.  i have another issue though but i am not sure if i can explain it correctly, or even if this is the right place for it. 

 

we use a cms system on our website and when we get to the page where we just had the error, if you try to add another listing 

 

(http://www.goodshepherds.org/management/index.php?action=edit&new_item=1&edit_id=&newsL-sort=title)   you just get a blank page. 

 

any suggestions?  thanks so much!

Link to comment
https://forums.phpfreaks.com/topic/67301-setcookie-error/#findComment-338584
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.