Ignore:
Timestamp:
Dec 17, 2009, 9:36:15 AM (14 years ago)
Author:
george
Message:
  • Přidáno: Podpora pro ukládání serverových proměnných HTTP sezení.
  • Upraveno: U funkce Explode lze nyní omezit počet výsledných částí řetězce.
Location:
branches/DirectWeb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/DirectWeb

    • Property svn:ignore
      •  

        old new  
        33WoWHostingWebServer
        44Config.xml
         5Session
  • branches/DirectWeb/UWebServer.pas

    r86 r87  
    66
    77uses
    8   Classes, SysUtils, UHTTPServer,
     8  Classes, SysUtils, UHTTPServer, UHTTPSessionFile,
    99  UTCPServer,
    1010  UCommon,
     
    2121  TWebServer = class
    2222  private
     23    HTTPSessionFile: THTTPSessionFile;
    2324    function PagesList(URL: string; Page, TotalCount, CountPerPage: Integer
    2425      ): string;
     
    244245  with Response.Stream do begin
    245246    Response.Cookies.Values['Test'] := 'Halo';
     247    //Response.Cookies.Values['Test2'] := 'Halo2';
     248
     249    HTTPServer.SessionHandler.Variables.Values['Session1'] := 'Value1';
     250    //HTTPServer.SessionHandler.Variables.Values['Session2'] := 'Value2';
    246251
    247252    WriteString('<a href="?ServerInfo">Refresh</a>');
    248253
    249254    WriteString('<h5>Request HTTP headers</h5>');
    250 
    251255    for I := 0 to Request.Headers.Count - 1 do begin;
    252256      WriteString(Request.Headers.Strings[I] + '<br/>');
     257    end;
     258
     259    WriteString('<h5>Request HTTP cookies</h5>');
     260    for I := 0 to Request.Cookies.Count - 1 do begin;
     261      WriteString(Request.Cookies.Strings[I] + '<br/>');
     262    end;
     263
     264    WriteString('<h5>Session variables</h5>');
     265    for I := 0 to HTTPServer.SessionHandler.Variables.Count - 1 do begin;
     266      WriteString(HTTPServer.SessionHandler.Variables.Strings[I] + '<br/>');
    253267    end;
    254268
     
    310324begin
    311325  inherited Create;
     326  HTTPSessionFile := THTTPSessionFile.Create;
     327  with HTTPSessionFile do begin
     328  end;
    312329  HTTPServer := THTTPServer.Create;
    313330  with HTTPServer, Socket do begin
     331    SessionHandler := HTTPSessionFile;
    314332    DocumentRoot := 'Data';
    315333    with RequestHandlerList do begin
     
    329347begin
    330348  HTTPServer.Destroy;
     349  HTTPSessionFile.Destroy;
    331350  inherited Destroy;
    332351end;
Note: See TracChangeset for help on using the changeset viewer.