Recent

Author Topic: fcl-web and session  (Read 4453 times)

thierrydijoux

  • New Member
  • *
  • Posts: 21
fcl-web and session
« on: January 03, 2013, 06:05:38 pm »
Hi,

i'm fighting with session in a cgi with fcl-web (lazarus 1.1 and fpc 2.7.1. When there is one web module, all is ok. When adding a second modules, the session is not shared, even when SessionCookiePath is set. Worse, on the first module, a new session is created each time the cgi is called.
If someone has some tips... It gave me a headache.

Thanks in advance

bobo

  • Full Member
  • ***
  • Posts: 171
Re: fcl-web and session
« Reply #1 on: January 03, 2013, 08:32:11 pm »
I am not using the built-in cookie sessions with fcl-web (using the in-url session tracking method personally), but asked Michael Van Canneyt (one of the fpc developers) about this:

"Modules and session are not related at all.
 I use many many modules, and never had a problem.
 
 Maybe the 'CreateSession' variable is different for each module ?
 
He should try checking the cookies being sent between server and browser..."

So this should not be a bug, just needs some debugging it seems. This can be a little tiresome with web apps, but with using log files it is possible.

thierrydijoux

  • New Member
  • *
  • Posts: 21
Re: fcl-web and session
« Reply #2 on: January 04, 2013, 09:45:30 am »
Thanks bobo, you show me the way ant it works now !
I've attached a sample project if someone need to deal with session.

devEric69

  • Hero Member
  • *****
  • Posts: 655
Re: fcl-web and session
« Reply #3 on: June 08, 2020, 12:43:13 pm »
(old post - 7 years ago - i know, but for information, fortunately I don't have this problem anymore due to the line below, in iniwebsession.pp, allowing to assign TCookie.path with '/':

Code: Pascal  [Select][+][-]
  1. C.Path:=SessionCookiePath;

See https://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packages/fcl-web/src/base/iniwebsession.pp?view=log
)
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

 

TinyPortal © 2005-2018