Previous Thread
Next Thread
Print Thread
Rate Thread
#215436 04/24/2002 8:04 AM
Joined: Mar 2002
Posts: 147
Member
Member
Offline
Joined: Mar 2002
Posts: 147
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).


Sponsored Links
Joined: Mar 2002
Posts: 147
Member
Member
Offline
Joined: Mar 2002
Posts: 147
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?

Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
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]]]]])

Joined: Mar 2002
Posts: 147
Member
Member
Offline
Joined: Mar 2002
Posts: 147
It is currently set at 1036800.

Which I believe is the default since I have not changed it.

Joined: Oct 2000
Posts: 49
Member
Member
Offline
Joined: Oct 2000
Posts: 49
Im getting exactly the same problem, amongst many others, so if anyone knows why please explain.

Sponsored Links
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
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']}");


UBB.threads Developer
Joined: Mar 2002
Posts: 147
Member
Member
Offline
Joined: Mar 2002
Posts: 147
It turns out that fixed it.
[]/forum/images/icons/grin.gif[/]
Thanks.

Joined: Oct 2000
Posts: 49
Member
Member
Offline
Joined: Oct 2000
Posts: 49
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.

Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
That line never worked off of a variable. It was just a "" because it's only a temporary cookie.


UBB.threads Developer
Joined: Apr 2002
Posts: 1,768
Addict
Addict
Offline
Joined: Apr 2002
Posts: 1,768
Since the PHP doc says that the third parameter is int, should it be 0 rather than "0"? Or does it not matter?

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)