Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2013-06-25 08:12:57

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 903

Setcookie

There are problems to cookies installation (login in forum) if time is broken and "Log me in automatically each time I visit." = off
http://fluxbb.org/forums/viewtopic.php?id=6326
http://fluxbb.org/forums/viewtopic.php?id=7129
If $expire (function setcookie) to make equal to zero for this case, cookies will be installed. Authorization will be valid or before browser shutdown, or throughout time of $pun_config ['o_timeout_visit'].


My modification of FluxBB 1.5.7 - rev.66
I speak only Russian  tongue

Online

#2 2013-06-25 13:56:51

sadex
Member
Registered: 2013-06-08
Posts: 10

Re: Setcookie

Yes, I agree with authorization failures. Many people have wrong system time of computers. Perhaps it is necessary, until the problem is solved, set the default Visit_timeout by 7200 seconds.

Last edited by sadex (2013-06-25 13:57:43)

Offline

#3 2013-06-26 15:45:20

ralfp
New member
Registered: 2012-11-21
Posts: 4

Re: Setcookie

This is why most software rounds cookie expiration dates up to days and validate on server instead. Client clock cannot be trusted.

Offline

#4 2013-07-04 05:25:31

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 903

Re: Setcookie

http://fluxbb.org/development/core/tickets/867/
One more person has problems, it is possible because of it.
So all audience can be lost wink


My modification of FluxBB 1.5.7 - rev.66
I speak only Russian  tongue

Online

#5 2013-07-04 09:39:05

adaur
Developer
From: France
Registered: 2010-01-07
Posts: 728
Website

Re: Setcookie

I'm sure we'll fix this in FluxBB 2.0!


Please excuse my bad english, I'm french tongue.

Offline

#6 2013-07-04 11:50:31

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 903

Re: Setcookie

Too long to wait.


My modification of FluxBB 1.5.7 - rev.66
I speak only Russian  tongue

Online

#7 2013-07-05 02:13:47

sadex
Member
Registered: 2013-06-08
Posts: 10

Re: Setcookie

adaur wrote:

I'm sure we'll fix this in FluxBB 2.0!

I do not like FluxBB 2.0. I love the branch FluxBB 1.5.

Offline

#8 2013-07-21 05:16:42

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 903

Re: Setcookie

Crutch for a solution:
in file functions.php

//
// Set a cookie, FluxBB style!
//
function forum_setcookie($name, $value, $expire)
{
	global $cookie_path, $cookie_domain, $cookie_secure;

	// Enable sending of a P3P header
	header('P3P: CP="CUR ADM"');

	if (version_compare(PHP_VERSION, '5.2.0', '>='))
		setcookie($name, $value, $expire, $cookie_path, $cookie_domain, $cookie_secure, true);
	else
		setcookie($name, $value, $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);
}

-->

//
// Set a cookie, FluxBB style!
//
function forum_setcookie($name, $value, $expire)
{
	global $cookie_path, $cookie_domain, $cookie_secure;

	global $pun_config;

	if ($expire - time() - $pun_config['o_timeout_visit'] < 1)
		$expire = 0;

	// Enable sending of a P3P header
	header('P3P: CP="CUR ADM"');

	if (version_compare(PHP_VERSION, '5.2.0', '>='))
		setcookie($name, $value, $expire, $cookie_path, $cookie_domain, $cookie_secure, true);
	else
		setcookie($name, $value, $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);
}

So short cookies won't depend on time on the local computer.


My modification of FluxBB 1.5.7 - rev.66
I speak only Russian  tongue

Online

#9 2013-07-25 16:10:45

seven
Member
From: Torino, Italy
Registered: 2010-08-19
Posts: 209
Website

Re: Setcookie

Wouldn't it be neater to use 0 as the default expiration time if the user didn't check the "remember me" option?


gamezoo.org - serious gaming services for serious gamers.

Offline

#10 2013-07-26 00:53:34

Visman
Member
From: Siberia
Registered: 2010-07-10
Posts: 903

Re: Setcookie

seven wrote:

Wouldn't it be neater to use 0 as the default expiration time if the user didn't check the "remember me" option?

No. Look the function pun_setcookie().


My modification of FluxBB 1.5.7 - rev.66
I speak only Russian  tongue

Online

#11 2013-07-26 09:44:30

seven
Member
From: Torino, Italy
Registered: 2010-08-19
Posts: 209
Website

Re: Setcookie

Oh, I see. You're definitely right, your code is the only way to do it.


gamezoo.org - serious gaming services for serious gamers.

Offline

#12 2013-07-31 09:03:07

nono18120
Member
Registered: 2012-07-20
Posts: 52

Re: Setcookie

hello,




I carried out the change of visman  I also have troubles about logout on version 1.5.3

Offline

Board footer

Powered by FluxBB 1.5.7