Re: How do I get hold of session information?
Thanks for your reply. I've taken a look at http://httpd.apache.org/docs/trunk/mod/mod_session.html, but like everything else in the area of Apache modules, the document is terse. Is there no documentation available on Apache Modules? There are a couple of books on Amazon, but is there nothing on the web? All I have found are snippets of information, usually poorly written (for example those referenced from here: http://modules.apache.org/reference.php), and the threebit tutorial. I haven't been able to find anything for those new to Apache and Apache Modules. For example, the mod_session page states: Creating a session is as simple as turning the session on, and deciding where the session will be stored. In this example, the session will be stored on the browser, in a cookie called session. Browser based session Session On SessionCookieName session path=/ But it doesn't say where or how to do this. I'm sure everyone in this group will take that sort of thing for granted, but it's infuriating for those of us coming to Apache Modules for this first time. The page also mentions the SessionEnv directive: If set to On, the SessionEnv directive causes the contents of the session to be written to a CGI environment variable called HTTP_SESSION. but it'd be great if there was some documentation somewhere that said where to set this, and how to read it from another module, assuming that this environment variable is in fact the only way to get hold of the session information in my module. It can't possibly be an environment variable in the true sense (getenv...) as there may be thousands of requests hitting the server. From: Ben Noordhuis i...@bnoordhuis.nl To: modules-dev@httpd.apache.org Sent: Tue, 19 October, 2010 17:46:40 Subject: Re: How do I get hold of session information? On Tue, Oct 19, 2010 at 17:30, Paul Donaldson pdonaldson_h...@yahoo.co.uk wrote: Thank you. I will take a look at mod_session. Will my module be able to check if mod_session is enabled (sorry, I don't know the Apache terminology) and, if it is, talk to it and ask it for what it has stored in its session? Yes. It exports an environment variable, see the SessionEnv directive for details.
Re: How do I get hold of session information?
It looks like mod_session has an API defined in http://httpd.apache.org/docs/2.2/sections.html and used by mod_auth_form -- I'd probably start there. whoops, wrong buffer: modules/session/mod_session.h -- Eric Covener cove...@gmail.com
How do I get hold of session information?
Hello, I have a module that does little more than take the information in the http request and forward it to another web site. I can get information from the query string easily enough, but is there any way I can get information about the session, and data stored in it? Thanks, Paul
Re: How do I get hold of session information?
In a Java servlet I may do something like this to get hold of the session on the web server: public void doPost(HttpServletRequest req, HttpServletResponse res) throws java.io.IOException { HttpSession session = request.getSession(true); Cart cart = (Cart)session.getAttribute(cart); ... and I can get hold of the session id etc. I assume that if I were to make a request to a web site hosted on Apache then the capability exists for one of the server side web pages to create a session and store some piece of data in it. What I want to do in my module is get hold of that session (if it exists) and read data from it. From: Eric Covener cove...@gmail.com To: modules-dev@httpd.apache.org Sent: Tue, 19 October, 2010 14:56:32 Subject: Re: How do I get hold of session information? On Tue, Oct 19, 2010 at 9:36 AM, Paul Donaldson pdonaldson_h...@yahoo.co.uk wrote: Hello, I have a module that does little more than take the information in the http request and forward it to another web site. I can get information from the query string easily enough, but is there any way I can get information about the session, and data stored in it? What session?
Re: How do I get hold of session information?
On Tue, Oct 19, 2010 at 17:05, Paul Donaldson pdonaldson_h...@yahoo.co.uk wrote: I assume that if I were to make a request to a web site hosted on Apache then the capability exists for one of the server side web pages to create a session and store some piece of data in it. What I want to do in my module is get hold of that session (if it exists) and read data from it. Apache core doesn't have a concept of sessions (or state as such) but take a look at mod_session.
Re: How do I get hold of session information?
Thank you. I will take a look at mod_session. Will my module be able to check if mod_session is enabled (sorry, I don't know the Apache terminology) and, if it is, talk to it and ask it for what it has stored in its session? From: Ben Noordhuis i...@bnoordhuis.nl To: modules-dev@httpd.apache.org Sent: Tue, 19 October, 2010 16:11:46 Subject: Re: How do I get hold of session information? On Tue, Oct 19, 2010 at 17:05, Paul Donaldson pdonaldson_h...@yahoo.co.uk wrote: I assume that if I were to make a request to a web site hosted on Apache then the capability exists for one of the server side web pages to create a session and store some piece of data in it. What I want to do in my module is get hold of that session (if it exists) and read data from it. Apache core doesn't have a concept of sessions (or state as such) but take a look at mod_session.
Re: How do I get hold of session information?
On Tue, Oct 19, 2010 at 17:30, Paul Donaldson pdonaldson_h...@yahoo.co.uk wrote: Thank you. I will take a look at mod_session. Will my module be able to check if mod_session is enabled (sorry, I don't know the Apache terminology) and, if it is, talk to it and ask it for what it has stored in its session? Yes. It exports an environment variable, see the SessionEnv directive for details.