2018-02-23 19:36 GMT-03:00 Michael Van Canneyt <mich...@freepascal.org>:
> > What is not clear ? There are several samples available that show their > use ? > > Also the WIKI has some pages about it > http://wiki.freepascal.org/fcl-web > > There are some articles > https://idefix.freepascal.org/~michael/articles/ > > see the web1 and web2 and webserver articles. > > I think Web2 explains what you need. According to your article, "Session support is introduced by TSessionHTTPModule". However, TFPHTMLModule descends from TCustomHTMLModule. TCustomHTMLModule descends from TCustomHTTPModule. Then, there is no session support for TFPHTMLModule. Another point: using TFPHTMLModule, request are handled by the module itself through the OnGetContent event, not by the actions. In the other words, the request never is transferred to the actions. *procedure TCustomHTMLModule.HandleRequest(ARequest: TRequest; AResponse: TResponse);* *Var* * FWriter : THTMLWriter;* * B : Boolean;* * M : TMemoryStream;* *begin* * FDocument := CreateDocument;* * Try* * FWriter:=CreateWriter(FDocument);* * Try* * B:=False;* * If Assigned(OnGetContent) then* * OnGetContent(Self,ARequest,FWriter,B);* * If Not B then* * Raise EHTMLError.Create(SErrRequestNotHandled);* * If (AResponse.ContentStream=Nil) then* * begin* * M:=TMemoryStream.Create;* * AResponse.ContentStream:=M;* * end;* * FDocument.SaveToStream(AResponse.ContentStream);* * Finally* * FreeAndNil(FWriter);* * end;* * Finally* * FreeAndNil(FDocument);* * end;* *end;*
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal