In using the AddXSLParams::BasicSession  AxKit plugin to make session 
variables available to an XSL stylesheet I have run into a slight problem:

My axkit pipeline consistes of several stages. First I do a little XSL 
transformation, then some XSP processing and then some more XSL 
transformations; quite a standard procedure I think. The final XSL 
stylesheet (which displays all the standard page elements - headers, 
footers etc) uses the parameter added by the AddXSLParams::BasicSession 
plugin to check if a particular 'userId' session variable exists. If it 
does exist, a little message saying 'Welcome $userId' is displayed at the 
top left of the page, and if not, a link to the logon page is given 
instead.

Now the problem lies in the login and logout pages.

On a sucessful login attempt, the login xsp page sets a 'userId' session 
variable and then calls a particular xsl template to display a welcome 
page.  On failure, it just displays the login form again and tells the 
user that the login attempt failed. So, after a sucessful login, a 
'welcomePage' template is called and then processing moves onto the final 
XSL template to convert the contents of the 'welcomePage' template (which 
is som site specific XML markup) into valid XHTML for final output to the 
browser.

The problem is that just after a sucessful login, even though the new 
'userId' session variable has just been set in the previous 
transformation, the final XSL stylesheet  in the pipeline  - which is 
using AddXSLParams::BasicSession  to check for the 'userId' session 
variable remember - doesn't  recognise the new session variable and so it 
displays the logon link in the top left of the page rather that the 
'welcome $userId' message.

It is not until I then navigate to another page that the new session 
variable becomes available and the correct message is displayed.

It's the same on logout. The user gets loged out (by unsetting the 
'userId' variable) and an xsl template is called which renders the goodbye 
page, then, as-per-usual the final XSL stylesheet gets called to produce 
the final XHTML outoput, but even thought the 'userId' session variable 
has just been unset, the parameter that has been passed to the stylesheet 
by the plugin still contains the userId and so the wrong message in the 
top left of the screen is displayed until you navigate to another page.

Obviously this is to do with the way the Axkit plugin is working. It must 
only be checking the session variables at the start of the pipeline rather 
than before each transformation.

But, is there a way around this? Can I tell it to re-process the session 
variables just before the final transformation somehow?


thanks in advance!

-- 
Tom David Kirkpatrick
Virus Bulletin Web Developer, Virus Bulletin

Tel: +44 1235 555139
Web: www.virusbtn.com


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

Reply via email to