Hi Derek,

sorry I missed the thread. Instead of adding it to the session, add it to the authentication context by using:

authContext.setXML("/authentication/colors", fragment)

Regards,

Jeroen Reijn


Derek Hohls wrote:
(Note: Posted this a month ago, no reply was offered
so I am trying again!)

Working with Cocoon 2.1.8.
I have set a session value for a user, using the session transformer in the sitemap. I now want to alter that value, based on other conditions. My sample testing flowscript code looks like: //1. get user's current session value
var _authContext  = contextMan.getContext("authentication");
var _currUserFrag = authContext.getXML("/authentication/colors"); var _currUserColors = Packages.org.apache.cocoon.xml.dom.DOMUtil.getValueOfNode(_currUserFrag);
print ("current Colors for user:" + _currUserColors);

//2. newColorID = "blue"
var newUserColors = _currUserColors + ',' + newColorID;
print ("new Colors:"+newUserColors);

//3. set new value in session
cocoon.session.setAttribute("cocoon.session.authentication.colors",newUserColors);

//4. check user's  new session value
_authContext  = contextMan.getContext("authentication");
_currUserFrag = authContext.getXML("/authentication/colors"); _currUserColors = Packages.org.apache.cocoon.xml.dom.DOMUtil.getValueOfNode(_currUserFrag);
print ("revised Colors for user:" + _currUserColors)
Part 1 might show a value of "red"; Part 2 then shows a value of "red,blue" but part 4 still shows a value of "red" - what needs to be different in the code? Thanks
Derek



--
Met vriendelijke groet,
Kind regards,

Jeroen Reijn

Hippo

Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel  +31 (0)20 5224466


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to