Item6012: POST data lost without previous login (query cache mechanism not 100%)

pencil
Priority: Urgent
Current State: Closed
Released In: 1.0.0
Target Release: patch
Applies To: Engine
Component: TWiki::UI
Branches:
Reported By: TWiki:Main.GilmarSantosJr
Waiting For:
Last Change By: KennethLavrsen
Using a fresh twiki svn checkout (I didn't test yet with TWikiRelease04x02):

  • Go to Sandbox.WebHome and change method definition of the form used to create new topics given a name: (original form doesn't have method attr, so it defaults to get)
<form method="post" action='%SCRIPTURLPATH{"search"}%/%WEB%/'>
  • Logout
  • Try to create a topic named 'TestTopic', for example
  • TWiki should ask you to login (I tested this issue with TemplateLogin)
  • You'll WYSIWYG editing Sandbox.WebHome, instead of TestTopic

It happens because it's necessary to be logged in to create a topic, so original POSTed data is cached and TWiki redirects you to login with twiki_redirect_cache URLPARAM adjusted, so original data can be loaded (and if you look at hidden field, all original POSTed data is there, including twiki_redirtect_cache). Then you POST login info and TemplateLogin, after validation, redirects you to origurl asking for a cache (TWiki::LoginManager::TemplateLogin::login() calls TWiki->redirect($origurl, 1)). TWiki::redirect calls TWiki::cacheQuery and this one returns empty string, since we already have a twiki_redirect_cache. Here comes the problem: the current twiki_redirect_cahce was defined at the first POST (the one that resulted on login screen) and was used (and erased! TWiki::UI unlinks cache file after read) and orignal data is lost.

The solution is quite simple: TWiki::UI should delete twiki_redirect_cache parameter after unlink (at this stage, it's not valid anymore). This way, if another cache is needed, then a new file is created and things works well.

-- TWiki:Main/GilmarSantosJr - 22 Sep 2008

I've just tested TWkiRelease04x02: it's ok. No changes needed.

-- TWiki:Main.GilmarSantosJr - 22 Sep 2008

ItemTemplate edit

Summary POST data lost without previous login (query cache mechanism not 100%)
ReportedBy TWiki:Main.GilmarSantosJr
Codebase
SVN Range TWiki-5.0.0, Fri, 12 Sep 2008, build 17509
AppliesTo Engine
Component TWiki::UI
Priority Urgent
CurrentState Closed
WaitingFor
Checkins TWikirev:17536
TargetRelease patch
ReleasedIn 1.0.0
Topic revision: r4 - 26 Dec 2008, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy