Skip to content

Commit

Permalink
session_on_database allows for heavy changes of session
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleteti committed Jan 15, 2025
1 parent a5e5f30 commit 4035859
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion samples/sessions_on_database/AppControllerU.pas
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ TApp1MainController = class(TMVCController)
[MVCHTTPMethod([httpGET])]
function Index: String;

[MVCPath('/inc')]
[MVCHTTPMethod([httpGET])]
function DoInc: String;

[MVCPath('/started')]
[MVCHTTPMethod([httpGET])]
function GetStarted: String;
Expand All @@ -33,7 +37,7 @@ TApp1MainController = class(TMVCController)
implementation

uses
TemplatePro;
TemplatePro, System.SysUtils;

{ TApp1MainController }

Expand Down Expand Up @@ -69,4 +73,15 @@ function TApp1MainController.Index: String;
end;
end;

function TApp1MainController.DoInc: String;
begin
if Session['value'].IsEmpty then
begin
Session['value'] := '0';
end;
Session['value'] := (Session['value'].ToInteger + 1).ToString;
Result := Session['value'];
end;


end.

0 comments on commit 4035859

Please sign in to comment.