Home Server

ValidateSessionParameters

edited July 2003 in Server
I'm trying to retrieve some values from a database in the server based
ValidateSessionParameters. Right now only the "IsValid" parameter can be
updated and returned. I'd like to conditionally update existing session
parameters and/or add some more session parameters in the server side
ValidateSessionParameters.

Can this be done?

More specifically I have a user ID and password provided as session
parameters from the web tier. I need to add "location" to the session
parameters which is retrieved from the database. Where is the best place
to do this in the server other than ValidateSessionParameters which can not
update the parameter list?


Thanks!

Comments

  • edited July 2003

    Try adding the Location parameter in the Server.OnGetSessionParameters
    event. I think that will enable you to use the ValidateSessionParameters
    event to retrieve the Location parameter value from the database and assign
    it to the aSessionParameters object that is passed to the event.


    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited July 2003
    I must have something wrong yet... It does not appear that I can set a
    SessionParameter value in either the GetSessionParameters or
    ValidateSessionParameters.

    *** From the WEBTIER I call -

    // Transfer page content params to session params
    aWebRequest.SessionParameters['UserName'].Value :=
    aWebRequest.ContentParameters['UserName'].Value;
    aWebRequest.SessionParameters['Password'].Value :=
    aWebRequest.ContentParameters['Password'].Value;
    aWebRequest.SessionParameters['Location'].Value := '';

    //Authenticate access to the server
    if not (rsWebTier1.ValidateSessionParameters(aWebRequest)) then
    Result := 'Access denied, Please log in.'
    else
    Result := rsWebTier1.ProcessWebRequest(aWebRequest);


    *** Then in the SERVER ValidateSessionParameters I set:

    aParameters.Items['Location'].AsString := 'Lost';


    The "location" parameter value never gets back to the WEBTier after the call
    to ValidateSessionParameters. Some debug code on the server side proves
    I'm setting the the value when the routine exists. The value is getting
    lost someplace? Maybe it's something dumb like the assigned is wrong?



  • edited July 2003

    In the WebTier custom parameters demo there is some code in the
    ProcessDefaultRequest method like this:

    if not rsWebTier1.SessionExists(aWebRequest) then
    Result := GetLoginPage(aWebRequest)


    And in the GetLoginPage method there is code like this:

    rsWebTier1.GetSessionParameters(aWebRequest);

    The above call will make a request to the server that will fire the
    OnGetSessionParameters event on the server. This enables the server to
    define session parameters and return them to the WebTier. The WebTier
    assigns the parameters to the WebRequest object.





    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.