Item14302: NatSkin uses a different cookie for the broadcast twisty, inconsistent with core.

pencil
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: NatSkin
Branches: master
Reported By: GeorgeClark
Waiting For:
Last Change By: MichaelDaum
Sometimes twisty states are stored in the FOSWIKIPREF cookie, eg:
Name   FOSWIKIPREF
Value   %7CTwistyPlugin_twistyIdSystemTwistyPlugin2%3D1
Host   .foswiki.org

But the twisty used in the closable broadcast message:
%TMPL:DEF{"broadcastmessage:contents"}%%TWISTY{ id="%BROADCASTID%" class="foswikiBroadcastMessage" showlink="" hidelink="%JQICON{"cross" style="float:right;"}%" remember="on" firststart="show" }% %BROADCASTMESSAGE% %ENDTWISTY%%TMPL:END% %{
is stored in it's own cookie:
Name   broadcastMessage_counter
Value   4
Host   test.blog.foswiki.org

This explains why dismissing the Broadcast on foswiki.org does not also dismiss it on the test blog.

This is with 2.1.3 Beta2 running, so other cookies are now all using the correct Domain for the host.

-- GeorgeClark - 25 Jan 2017

Actually dismissing the twisty on foswiki.org proper does use the correct cookie, so this seems to be specific to NatSkin.
Name   FOSWIKIPREF
Value   %7CTwistyPlugin_twistyIdSystemTwistyPlugin2%3D1%7CTwistyPlugin_BC081%3D0
%7CTwistyPlugin_BC081 is the broadcast ID twisty on foswiki.org,

-- GeorgeClark - 25 Jan 2017

Confirming this as a NatSkin inconsistency with core. The broadcast message uses a NatSkin implementation for the twisty, which generates the cookie in pub/System/NatSkin/natskin.uncompressed.js. In addition it's not using the {Sessions}{CookieRealm} so the skin isn't really shareable between multiple hostnames in the domain.

-- GeorgeClark - 25 Jan 2017

It does use a different cookie for a good reason. It deliberately does not use TwistyPlugin as it does not cover the actual requirement coming with the broadcast message.

Confirmed: it should use the new cookie realm and security flags as noted by Item14281

The current implementation of the broadcast message in NatSkin is not optimal. It is in fact quite annoying as it pops up again every 4 clicks even though it has been clicked away by the user.

There is a better way: hide the broadcast message once the user clicked it away and never show it again, unless the broadcast message has changed. Then it must be forced open again to inform the user about the new brodcast message.

This is clearly something that can't be done using TwistyPlugin.

The original Summary "NatSkin uses a different cookie for the broadcast twisty, inconsistent with core." is not quite on the point. And by far this task is not urgent. This is an improved feature.

Btw we already have 4 or 5 cookies created by Foswiki. For example, UpdatesPlugin does have its own cookies, i.e. it does not use FOSWIKIPREF which is actually only been used by TwistyPlugin as far as I know.

-- MichaelDaum - 25 Jan 2017
 

ItemTemplate edit

Summary NatSkin uses a different cookie for the broadcast twisty, inconsistent with core.
ReportedBy GeorgeClark
Codebase 2.1.3 beta2, 2.1.3 beta1
SVN Range
AppliesTo Extension
Component NatSkin
Priority Urgent
CurrentState Closed
WaitingFor
Checkins NatSkin:4f0e9461ba1a
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches master
trunkCheckins
masterCheckins NatSkin:4f0e9461ba1a
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r2 - 25 Jan 2017, MichaelDaum
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