UBB.Dev
Posted By: casper_dup1 6.0 br1 setcookie() error - 04/24/2002 3:04 PM
Getting an error after I login leave and then come back......

Warning: setcookie() expects parameter 3 to be long, string given in C:\inetpub\wwwroot\mywebsitesdir\ubbt\ubbt.inc.php on line 1619
[]/forum/images/icons/confused.gif[/]

Cleared all my cookies. Went to the Main index page (no error). Logged in (no error). Left and came back to the Main Index (recieved error above).

Posted By: casper_dup1 Re: 6.0 br1 setcookie() error - 04/24/2002 3:09 PM
Parameter 3 ( I am going to assume this is line 3)= the web site.....

So my cookie for UBBDEV (line 3):
www.ubbdev.com/

My cookie for my site (line 3):
www.unnecessaryroughness.com/

Any thing to do with the length of the domain name?
Posted By: Dave_L_dup1 Re: 6.0 br1 setcookie() error - 04/24/2002 8:12 PM
The third parameter to set_cookie() is the expires value. I assume that's the value in seconds specified in the admin settings. What value are you using?

int setcookie ( string name [, string value [, int expire [, string path [, string domain [, int secure]]]]])
Posted By: casper_dup1 Re: 6.0 br1 setcookie() error - 04/24/2002 10:45 PM
It is currently set at 1036800.

Which I believe is the default since I have not changed it.
Posted By: kristian Re: 6.0 br1 setcookie() error - 04/25/2002 1:29 AM
Im getting exactly the same problem, amongst many others, so if anyone knows why please explain.
Posted By: Rick Re: 6.0 br1 setcookie() error - 04/25/2002 3:05 AM
It turns out that the time should never just be left blank, instead use a zero, so that line on 1619 should look like this:

setcookie("w3t_mysess","$newsessionid","0","{$config['cookiepath']}");
Posted By: casper_dup1 Re: 6.0 br1 setcookie() error - 04/25/2002 5:15 AM
It turns out that fixed it.
[]/forum/images/icons/grin.gif[/]
Thanks.
Posted By: kristian Re: 6.0 br1 setcookie() error - 04/25/2002 11:40 AM
So basically your saying hardcode that and prevent it using the variable, isnt there anyway it can be made to work with the variable. If this was in my native programming language im sure it would be pretty easy.
Posted By: Rick Re: 6.0 br1 setcookie() error - 04/26/2002 2:42 AM
That line never worked off of a variable. It was just a "" because it's only a temporary cookie.
Posted By: Dave_L_dup1 Re: 6.0 br1 setcookie() error - 04/26/2002 2:52 AM
Since the PHP doc says that the third parameter is int, should it be 0 rather than "0"? Or does it not matter?
© UBB.Developers