[fpc-pascal] [FCL-WEB] Multiple Modules - On Session

African Wild Dog paintedlycaon at gmail.com
Tue Mar 20 01:03:54 CET 2018


I am trying to implement authentication in my application using the
provided IniWebSession unit. I have created a separate module to handle
authentication. So, i have two modules modules. In my main module, in the
OnRequest event handle, i check for session variables ('username') to
determine if the user is logged in. If not, it redirects to the login page,
which is handled by the authentication module.

It seems that session management create one separate session by each
module. Both modules have the property "CreateSession" set to True. If i
turn off "CreateSession" property on MainModule, when i try to access
session variables in OnRequest event handler i get this error: "Default
session not available outside handlerequest".

What i am doing wrong? Please help

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20180319/d70c9a3b/attachment.html>

More information about the fpc-pascal mailing list