Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Allow only active sessions access to a THandlers?
#1
I'm trying to implement Server-side datatables.  
In my template I have something like this:

Code:
<script type="text/javascript" class="init">
$(document).ready(function() {
$('#UTCDRTABLE').DataTable( {
                    "serverSide": true,
                    "processing": true,
                    "ajax": "GetSomeData",
                    "order": [[ 1, "desc" ]]
                });
} );
</script>

... and in the ServerController I registered a THandlers like this:

Code:
with THandlers.Add('', 'GetSomeData', TContentGetSomeData.Create) do
begin
  CanStartSession := true
  RequiresSessionStart := false;
end;

... and I want only users that already have an active session (logged in) to access https://myip/GetSomeData and if the user is not logged in, to be redirected to the login page (main page). 
The way is set up now, as in the code above, everyone can try to GetSomeData and any combinations of true of false I tried for CanStartSession,  RequiresSessionStart doesn't get me the result I need. Actually, if I change anything on how I declare the THandlers.Add, I never get to TContentGetSomeData.Execute

What am I doing wrong and is this the way to do it?
Reply


Messages In This Thread
Allow only active sessions access to a THandlers? - by ioan - 07-15-2020, 09:12 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)