01234: @@$LoginRedirectFmt@@ would be useful

Summary: $LoginRedirectFmt would be useful
Created: 2010-11-22 07:28
Status: Open
Category: Feature
From: JL
Assigned:
Priority: 3
Version: 2.2.19
OS: Linux/Apache/5.3.3

Description: I have set up one of my PmWiki sites in a way that there is only a login link (?action=login) and all page actions a hidden by default. The items in Site/PageActions are only displayed after a user has logged in. But these items are sometimes not displayed after login because the browser does not reload the page.

To solve this problem it would be nice if PmWiki either redirects to CurrentGroup/CurrentPage?action=browse after a login or had a $LoginRedirectFmt varialbe.

This sounds like a browser caching problem to me...? —Peter Bowers November 25, 2010, at 01:03 PM

I use the FastCache cookbook and I have set up my server to tell the browser to cache the "FastCache" files. Since you are redirected to an url the browser has already cached (after login), the browser takes the cached page instead of reloading it. Thus, the browser behaves correctly. I want to force a reload by adding a query string to the url (e.g. ?action=browse). JL December 05, 2010, at 06:29 PM

You may be able to fix this by adding to config.php such a line:
if ($action == 'login') $FastCacheValid = 0;
Tell us if this works. See also the section "Cache HTTP headers" at Cookbook:FastCache. --Petko December 05, 2010, at 08:10 PM

Thanks for these hints. I will review them and report the results here soon. A $LoginRedirectFmt variable would still be nice ;). JL December 06, 2010, at 07:50 AM

Setting the $FastCacheValid variable to false just ensures that the cookbook will not create a cache file. I solved it now with the HTTP headers changes despite of the disadvantage that the browser will download the cached file on every site visit now. JL December 15, 2010, at 04:38 PM

The lines in the section "Cache HTTP headers" at Cookbook:FastCache will not cause a browser to download the file every time. The browser will download it only if the file has changed. The header Cache-Control "public, must-revalidate" will even allow all transit proxies (your ISP) to cache the file, so you may even not connect to your wiki as long as there is no newer version of the cached page. See the relevant section of the HTTP/1.1 standard - this header is about transit caching proxies, not about your browser cache. --Petko January 10, 2011, at 10:30 PM