Session TagsSituationA web designer is creating a site which will need users to log into it. Logging in will provide the user with a session tag, which must be provided to the site with each request. The web designer does not wish to rely on cookies or HTTP basic realm authentication, nor do they want to pass the session tag in a query string (or hidden form item) each time. The web designer also has a lot of legacy scripts which they wish to re-use. The scripts expect session information to be provided in an environment variable, and some of them create URLs of the form
SolutionThe session tag can be stored in the hostname of the site, and a rewrite script can be used to put this information into an environment variable (or two) for the legacy scripts. Use a request rewrite script similar to the following:
ExplanationThe first set of rewrite rules translates URLs that contain The second set of rules searches for session information in the URL, and translates it into a The two rules together then present a consistent interface to the scripts running on the site, without breaking any existing functionality. |
Recently...
Other Resources
|





