Cookies

Started by Yeehaw, March 18, 2004, 07:32:36 AM

Previous topic - Next topic

[Unknown]

Umm, you replaced the wrong one.  Try making the logout one this:

setcookie($cookiename, serialize(array(0, '')), time() + 31536000, '/', '.desertaquaria.com');

And the Login one this:

setcookie($cookiename, serialize(array($ID_MEMBER, $password)), time() + 31536000, '/', '.desertaquaria.com');

And then remove the die().

-[Unknown]

Lord_Novice

Quote from: [Unknown] on March 21, 2004, 04:24:28 PM
You can redirect it to another folder in php.ini, but that's global to all of PHP...

-[Unknown]

Would it be this field: session.cookie_path = /

Or is it another? Thanx
Não subestime os Superaprendizes

Pocket Heroes recruta Superaprendizes

Yeehaw

Quote from: [Unknown] on March 21, 2004, 06:03:12 PM
Umm, you replaced the wrong one.  Try making the logout one this:

setcookie($cookiename, serialize(array(0, '')), time() + 31536000, '/', '.desertaquaria.com');

And the Login one this:

setcookie($cookiename, serialize(array($ID_MEMBER, $password)), time() + 31536000, '/', '.desertaquaria.com');

And then remove the die().

-[Unknown]

No effect - sets cookie for one hour. Frustrating.
www.desertaquaria.com/breeze running SMF!
For a non-pc board, go to Desert Whispers at above forum ;)

[Unknown]

Can you put this before the login one:

die(timeformat(time() + 31536000));

And try to login?

It should die with an error message - or rather, with the date it means the cookie to expire on.

-[Unknown]

Yeehaw

It replies with this : March 21, 2005, 06:10:52 pm

I take the "die" string out and Firefox says "Sunday, March 21, 2004 9:02:04 PM"

*sigh*
::)
www.desertaquaria.com/breeze running SMF!
For a non-pc board, go to Desert Whispers at above forum ;)

[Unknown]

So, in other words, your server is changing the header?

Maybe if we just do like a month or so.

setcookie($cookiename, serialize(array($ID_MEMBER, $password)), time() + 3153600, '/', '.desertaquaria.com');

-[Unknown]

Yeehaw

Quote from: [Unknown] on March 21, 2004, 08:20:38 PM
So, in other words, your server is changing the header?

Maybe if we just do like a month or so.

setcookie($cookiename, serialize(array($ID_MEMBER, $password)), time() + 3153600, '/', '.desertaquaria.com');

-[Unknown]

First of all, why would the cookie code in YaBBSE work and SMF cannot? This does not make any sense whatsoever that it's my host server. None.

Second of all, we're in the same place "Sunday, March 21, 2004 9:31:50 PM" - One hour.
www.desertaquaria.com/breeze running SMF!
For a non-pc board, go to Desert Whispers at above forum ;)

[Unknown]

It's the same though.

$cookie_url = explode('<yse_sep>', url_parts());
$cookie = serialize(array($settings['ID_MEMBER'], $password));
$ctime = time() + (60 * $Cookie_Length);

setCookie($cookiename, $cookie, $ctime, $cookie_url[1], $cookie_url[0]);


Or for SMF:

$cookie_url = url_parts();
$cookie = serialize(array($ID_MEMBER, $password));
$ctime = time() + (60 * $modSettings['cookieTime']);

setCookie($cookiename, $cookie, $ctime, $cookie_url[1], $cookie_url[0]);


-[Unknown]

Yeehaw

www.desertaquaria.com/breeze running SMF!
For a non-pc board, go to Desert Whispers at above forum ;)

[Unknown]

The only difference is SMF uses the last parameter to say that the cookie should be set even if not over ssh.  (this is the default, but why not say it anyway :D?)

-[Unknown]

Yeehaw

This is too damn funny!

Ok, I've been messing around with load.php and loginout.php for the last 7 hours, cleaned up all the old yabbse folders and files (change your dirs in "themes&settings -> yabbse classic" before you do) so it looks approximately like SMF default install. Reloaded the stock load and loginout, ended up with using the Kris cookie hack due to the host header issue, so I was back to the same problem.

[Interlude]
Stared at monitor for 30 minutes
[/Interlude]

Had the bight idea of going to "edit features and options", changing the default cookie length to "3153600", and seeing where that took me. Firefox reports cookie good until "Thursday, March 25, 2010 4:08:50 PM". Good. That will keep my users happy for the time being.

So, hard-coding the cookie didn't work. Clicking the "Forever" box didn't work. Why? Why? Why?
I also wonder if the php sessions was doing something that stopped the cookie from being set correctly concerning length of time since it always dies at end of session.
www.desertaquaria.com/breeze running SMF!
For a non-pc board, go to Desert Whispers at above forum ;)

[Unknown]

Interesting.  Actually, the cookie length you gave it would be 3153600 * 60, which is a CRAP OF A LOT.

So.. hmm... increase "forever" amount of time?

-[Unknown]

Yeehaw

Quote from: [Unknown] on March 27, 2004, 01:24:00 AM
Interesting.  Actually, the cookie length you gave it would be 3153600 * 60, which is a CRAP OF A LOT.

-[Unknown]

Yeah, six years is pretty much forever as far as software is concerned, eh?
;)
www.desertaquaria.com/breeze running SMF!
For a non-pc board, go to Desert Whispers at above forum ;)

[Unknown]

 ! Changed cookie login time to a lot of years because it fixed some issues ;). (verified in many browers.)

We'll see, then.

-[Unknown]

Advertisement: