The makeSessionVarIDID() function builds a session variable.
makeSessionVarIDID(expr1,expr2)
<input type="hidden" gwc:attributes="name makeSessionVarIDID('var1','value1')" />