Page MenuHomePhabricator

Logout: still displays as if logged in after logout
Closed, ResolvedPublic

Description

Author: timwi

Description:
BUG MIGRATED FROM SOURCEFORGE
http://sourceforge.net/tracker/index.php?func=detail&aid=1009202&group_id=34373&atid=411192
Originally submitted by bigmamacare (bigmamacare) 2004-08-14 16:41

This obviously does not impact any function but it is
annoying because one's not shure about logon status.
This can be observed in any browser (Firefox/Mozilla, IE
and so on).

MySQL Version: MySQL 3.23.57-log
running on Linux 2.4.25_pre7-gss-r3 using an
Apache/1.3.27 (Unix).


Version: unspecified
Severity: minor

Details

Reference
bz63

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 6:47 PM
bzimport set Reference to bz63.
bzimport added a subscriber: Unknown Object (MLST).

The session cookie should remain on logout, so it ought to be possible to slip another cache expiration timestamp into the session. This will only
last until the browser is closed, however.

timwi wrote:

*** Bug 74 has been marked as a duplicate of this bug. ***

xtium wrote:

May this problem caused by <MediaWiki>/includes/SkinTemlate.php:

I think the values should be read from cookie. Or the global variable $wgUser
should be updated.

from Line 417:

			if( $wgShowIPinHeader && isset(  $_COOKIE[ini_get("session.name")] ) ) {
				$personal_urls['anonuserpage'] = array(
					'text' => $this->username,
					'href' => &$this->userpageUrlDetails['href'],
					'class' => $this->userpageUrlDetails['exists']?false:'new'
				);

........

(In reply to comment #3)

May this problem caused by <MediaWiki>/includes/SkinTemlate.php:

What that bit does is to show a generic header (just the login link) if you don't have a session or login
active, so that the page output can be cached and served to all other visitors who don't have a session or
login active. If you are logged in or have a session active (eg, you're logged in, OR you've visited the login
page, OR you've edited something), then it will show you user name (IP address if you're not logged in) and
talk page.

This is unrelated to the problem of this bug, which is that the logged-in page view is retained in the local
browser cache after logout.

xtium wrote:

(In reply to comment #4)

(In reply to comment #3)

May this problem caused by <MediaWiki>/includes/SkinTemlate.php:

What that bit does is to show a generic header (just the login link) if you

don't have a session or login

active, so that the page output can be cached and served to all other visitors

who don't have a session or

login active. If you are logged in or have a session active (eg, you're logged

in, OR you've visited the login

page, OR you've edited something), then it will show you user name (IP address

if you're not logged in) and

talk page.

This is unrelated to the problem of this bug, which is that the logged-in page

view is retained in the local

browser cache after logout.

Yes, I also found out that.
I can fix this display problem by the following workaround, but I am not sure if
it is correct to the execution of the whole MeidaWiki system. I just disabled
the cache in returnToMain method, this works on my FreeBSD, I did not test it on
Windows.

//<MediaWiki>/includes/OutputPage.php
function returnToMain( $auto = true, $returnto = NULL ) {

		global $wgUser, $wgOut, $wgRequest;

		//added by Junhua Wang start
		$this->enableClientCache( false );
		//added by Junhua Wang end

......

xtium wrote:

(In reply to comment #5)

(In reply to comment #4)

(In reply to comment #3)

May this problem caused by <MediaWiki>/includes/SkinTemlate.php:

What that bit does is to show a generic header (just the login link) if you

don't have a session or login

active, so that the page output can be cached and served to all other visitors

who don't have a session or

login active. If you are logged in or have a session active (eg, you're logged

in, OR you've visited the login

page, OR you've edited something), then it will show you user name (IP address

if you're not logged in) and

talk page.

This is unrelated to the problem of this bug, which is that the logged-in page

view is retained in the local

browser cache after logout.

Yes, I also found out that.
I can fix this display problem by the following workaround, but I am not sure if
it is correct to the execution of the whole MeidaWiki system. I just disabled
the cache in returnToMain method, this works on my FreeBSD, I did not test it on
Windows.

//<MediaWiki>/includes/OutputPage.php
function returnToMain( $auto = true, $returnto = NULL ) {

		global $wgUser, $wgOut, $wgRequest;

		//added by Junhua Wang start
		$this->enableClientCache( false );
		//added by Junhua Wang end

......

And it seems IE works well with this workaround but Firefox1.0 not. If I want
make all the browsers compliant, the line added by me should be moved to method
"output" in OutputPage.php, and I don't think it is a good solution to this
problem... :(

(In reply to comment #5)

$this->enableClientCache( false );

This would tell the browser not to cache the page which says "You
are now logged out." etc, while having no effect on anything else.
Since it's an uncacheable special page and not one you'd revisit, I
don't think this would actually accomplish anything.

tom wrote:

Fixed in CVS: set cookie with logged in and log out timestamp, then check them when checking If-Modified-Since.