1
Sessions stored in the URLs with Login, example
2
======================================
3
(Requires FPC versions past 4/30/2009 /revisions 13062 and later/)
6
Every visitor needs to log in to get a session ID that is always passed in the
7
URLs of the response pages as a query parameter and stored on the web server
9
This way fully functional web sites can be built without mixing the different
10
visitor's screens and without using cookies to keep the session separated.
12
Note: Because the session ID is stored dynamically in the generated pages, all
13
web browser tabs will have separate sessions after logging in with them.
14
The sample user logins are stored in userdb.txt for the example.
18
The web server application needs read/write access to the file where the session
19
informations will be stored with the login names (session-db.txt by default).
23
Usually it works if you put the templates next to the CGI executable file.
24
(testurllogin.html, testurllogout.html, testurlwelcome.html,
25
testurlsomepage.html and userdb.txt)
27
http://<WebServer>/cgi-bin/<CGIExecutableName>/login should start the
28
example if everything is set up properly.
29
ex: http://127.0.0.1:8080/cgi-bin/urlsession.exe/login
31
Note: You need to change the URLs in the templates if "cgi-bin" or
32
"urlsession.exe" changes (for example on Linux it is not urlsession.exe).
38
Usually it works if you put the templates into the Apache main directory (not
39
the DocumentRoot, but the main Apache directory).
40
(testurllogin.html, testurllogout.html, testurlwelcome.html,
41
testurlsomepage.html and userdb.txt)
43
http://<WebServer>/<ApacheLocationName>/login should start the
44
example if everything is set up properly.
45
ex: http://127.0.0.1:8080/myapache/login
46
if in httpd.conf it was set up as:
47
LoadModule mod_urlsession "<path_to_mod>/mod_urlsession.dll"
49
SetHandler mod_urlsession
54
Note: You need to change the URLs in the templates if "myapache" changes.
55
Also, for example on Linux the module can be mod_urlsession.so and not
59
Note: If you recompile an apache module while the module itself is loaded into
60
the Apache server, the compilation will fail because the file is in use (Apache
61
modules stay in the memory). So first you always need to stop the server before
62
you recompile or before you copy over the new version of the created module.
66
(*)To use the same templates for both CGI programs and Apache modules the
67
links can also be generated dynamically when the response html pages are
68
generated. For example instead of putting
70
/cgi-bin/urlsession.exe/login
73
into the templates, a tag can be used to put the righ link there.
75
<form action="{*SCRIPTPATH*}/login" method="post" ...