The SectionHeadControl is hardcoded to persist its open/closed state via the page's v13wstat3. However, the underlying DNNClientAPI.EnableMinMax method does permit specification of two other ways to persist state - DNNClientAPI.MinMaxPersistanceType.Cookie and MinMaxPersistanceType.Personalization which as you can guess uses a client cookie or for registered users the DNN Profile/Personalization store.
I recall that rather than using the SectionHeadControl I made use of the EnableMinMax method with MinMaxPersistanceType.Cookie when the user was unauthenticated and MinMaxPersistanceType.Personalization when the user was authenticated to maintain user preference for a collapsable section in a view control of my EPrayer module. Here is a section of that code:
In the view control's .ascx markup:
<asp:Image id="btnFilterRequests" runat="server" border="0" /><asp:Label ID="lblFilterRequests" ResourceKey="lblFilterRequests.Text" CssClass="NormalBold" runat="server"></asp:Label>
<table id="tblFilterRequests" border="0" rules="none" cellpadding="2" width="100%" runat="server">
. . .
</table>
In the view control's codebehind (PreRender event handler):
Private Const minIcon As String = "images/minus.gif"
Private Const maxIcon As String = "images/plus.gif"
. . .
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
Dim persistanceType As DNNClientAPI.MinMaxPersistanceType
If IsAnonymous Then
persistanceType = DNNCLientAPI.MinMaxPersistanceType.Cookie
Else
persistanceType = DNNClientAPI.MinMaxPersistanceType.Personalization
End If
DNNClientAPI.EnableMinMax(btnFilterRequests, tblFilterRequests, True, Page.ResolveUrl(minIcon), Page.ResolveUrl(maxIcon), persistanceType)
End Sub
Since the content of each section will be downloaded from the server when the page is first rendered, there should be no postback each time a section is opened or closed that is displayed or hidden via css client side. I was surprised to find that the SectionHeadControl did not expose a property for specifying the MinMaxPersistanceType - would have saved having to write the above code.