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

Michael Van Canneyt michael at freepascal.org
Thu Mar 22 09:44:46 CET 2018

On Wed, 21 Mar 2018, leledumbo via fpc-pascal wrote:

>> It seems that session management create one separate session by each module
> That's right but should be OK, as the session is created based on cookie,
> which if already exists, will be loaded instead of created. If memory serves
> right, I remember you should set one or a few of these:
> * fphttp.SessionFactory.SessionCookie
> * fphttp.SessionFactory.SessionCookiePath
> optionally, to easily check the created session files, you might want to
> also set:
> * (fphttp.SessionFactory as iniwebsession.TIniSessionFactory).SessionDir

A cookie is associated with a URL path. That means that
will by default have a different cookie then

In order to share a cookie between modules, you must set SessionCookiePath
at the start of the program:


This will emit a cookie that has / as the path.

See also the fixed example at:


More information about the fpc-pascal mailing list