How to access passed HTTP header info for MiServer v2.0

First question: are you using MiServer 2 or 3?

We've rationalized how things are accessed better in MiServer 3.. so the way to access passed HEADER fields is different than in 2.1.

For MiServer 2.x scripting, you get at the fields through req (or whatever variable you're passing to Render).

For instance: req.Page will give the page name that was requested.

 

The list of fields available through req is:

    :Field Public Instance Input

    :Field Public Instance Headers

    :Field Public Instance Command

    :Field Public Instance Page

    :Field Public Instance Arguments

    :Field Public Instance PeerAddr

    :Field Public Instance PeerCert

    :Field Public Instance Data

    :Field Public Instance Cookies

 

If you're looking for data passed from the URL or as a part of form data, that's in req.Data

Individual user sessions are implemented with the SimpleSessions class found in the Extensions folder.

Each session has an ID.  There is a cookie associated with the session in the user's browser.

This is why sessions in different browsers will have unique sessions, but sessions in tabs in the same browser, or even multiple instances of the same browser will share a session.

 

Every request has a session associated with it.

In MiServer 2.1, the request is passed to the Render function, so, the session ID should be available as req.Session.ID 







  • 3 Users Found This Useful
Was this answer helpful?

Related Articles

MiServer APL Web Hosting Concepts

The beauty of running your own APL-based MiServer web server is that you have 100% full control...