Re: LiveUser - session_set_cookie_params()
Arnaud Limbourg <[email protected]>
| Newsgroups | gmane.comp.php.pear.devel,gmane.comp.php.pear.liveuser |
|---|---|
| Message-ID | <[email protected]> |
Koistya `Navin wrote:
>I thinks there is a bug in session_set_cookie_params() - LiveUser.php, line:
>906
>
>
>
>At least this way it doesn't work with IE.
>
>
>
>Original code:
>
>
>
> if ($this->_options['session_cookie_params']) {
>
> session_set_cookie_params((
>
> time() + (LIVEUSER_DAY_SECONDS *
>$this->_options['session_cookie_params']['lifetime'])),
>
> $this->_options['session_cookie_params']['path'],
>
> $this->_options['session_cookie_params']['domain'],
>
> $this->_options['session_cookie_params']['secure']);
>
> }
>
>
>
>Change suggestion:
>
>
>
> if ($this->_options['session_cookie_params']) {
>
> session_set_cookie_params(
>
> (60 * 60 * 24 *
>$this->_options['session_cookie_params']['lifetime']),
>
> $this->_options['session_cookie_params']['path'],
>
> $this->_options['session_cookie_params']['domain'],
>
> $this->_options['session_cookie_params']['secure']);
>
> }
>
>
>
>
Hi,
I changed it to hardcoded number of seconds, 86400 for a day as it will
not likely change.
I'm cc'ing LU list as they may have a reason for the constant for which
I am unaware. For the record, I don't see the added value in using a
constant (as we know constants are slow) when the number of seconds in a
day will not change in the near future. Doing the math 60*60*24 at every
file load seems like a waste.
Arnaud.
--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php