Recent Topics

1 Aug 17, 2008 21:48    

My b2evolution Version: 2.x

Hi,

I want my user's session to expire when they close the browser (so they have to login again next time the browser starts).

In the old days (I was using 0.9.1) I had:
$cookie_expires = 0;

in _advanced.php

and that seemed to do the trick.

But now even when I changed the same value for 2.4.2, the cookie is still set to expire (strangely) in 10 year's time.

Any hints?

Thanks.

2 Aug 21, 2008 03:38

Line 294 in /conf/_advanced.php (I use the CVS version but I don't think this is different in 2.4.2)

/**
 * Expiration for cookies.
 *
 * Value in seconds, set this to 0 if you wish to use non permanent cookies (erased when browser is closed).
 *
 * @global int Default: time() + 31536000; // One year from now
 */
$cookie_expires = time() + 31536000;

or do you think you found a bug?

Good luck

3 Aug 21, 2008 03:52

I found this in /inc/sessions/model/_session.class line 221

			// Set a cookie valid for ~ 10 years:
			setcookie( $cookie_session, $this->ID.'_'.$this->key, time()+315360000, $cookie_path, $cookie_domain );


This is called when no cookie exists. Try changing the time part in this code with $cookie_expires or set a cookie for one hour. I get the feeling it needs a session cookie, so B2evo might not work as expected or crash when the cookie expires. Perhaps you are caught in a development stage where the session cookie's role is enhanced but someone forgot to remove the $session_expires in _advanced.php
I haven't bothered with the cookies that much, so I can't provide you with more information than this.

Good luck


Form is loading...