Sponsored Content
Top Forums Web Development Apache module development on apache 2.2 Post 302921213 by DGPickett on Wednesday 15th of October 2014 04:11:14 PM
Old 10-15-2014
In CGI, you have to read the POST data from stdin, sometimes just one line, and decode it.

A cookie is set by an HTTP Set-Cookie line and retrieved from $HTTP_COOKIE: Cookie Specification CGI is funny tht way, making you write almost all the output HTTP but reading most of the incoming HTTP for you. CGI Variables

The usual languages (PERL,Ruby,JAVA) have libraries so you can not know a lot of this.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

get error while compiling apache with php module

hi, i'm compiling apache with php module after i finish compile mysql-4.0.0-alpha. i do it as the follow steps after untar'ed them in the same directory, 1) cd apache_1.3.22 ./configure 2) cd php-4.0.6 ./configure --with-mysql=/usr/local/mysql \ --with-apache=../apache_1.3.22 \... (2 Replies)
Discussion started by: jApHEth
2 Replies

2. Filesystems, Disks and Memory

Mog_Gzip a Module For Apache

Mod_gzip, at http://www.remotecommunications.com/apache/mod_gzip/ is a module for Apache that allows you to compress content from an Apache web server on-the-fly. It uses the same compression as gzip and no plugins or extra software is needed by your browser to take advantage of this product.... (0 Replies)
Discussion started by: binhnx2000
0 Replies

3. HP-UX

Module jk2 failed to load into apache server!!

Hi There, Does anyone knows what could be the problem if my apache server is running but unable to load JK2 module into the server. My HTTPS is running on Apache Server 2.0.49 with ssl enabled and compiled with Mod_ssl on HPUX-11.11i. In fact we have try out the following parameter, ... (4 Replies)
Discussion started by: e_jeffhang
4 Replies

4. UNIX for Dummies Questions & Answers

Howto locate locally installed Perl module for a CGI script in APACHE .htaccess

Hi, I have the following simple CGI script, just containg header: #!/usr/bin/perl -w use CGI ':standard'; use lib "/home/myname/lib/perl5/site_perl/5.8.5/"; use Mail::Sendmail; I also have included this directive in ~/public_html/.htaccess : SetEnv PERL5LIB... (0 Replies)
Discussion started by: monkfan
0 Replies

5. Solaris

Apache on Solaris10 configured with loadable module support?

I have Apache 2 webserver as delivered with the Solaris 10 installation. How to verify if Apache is configured with loadable module support? Or if needs to be recompiled with loadable module support. (2 Replies)
Discussion started by: kavera
2 Replies

6. UNIX and Linux Applications

Apache module compilation error

I'm trying to compile an apache module (a tutorial module, Apache 2 Module Tutorial - GNU Build Tools and the Development Environment) and I get errors like this: apr.h:273: error: expected ´=´, ´,´,´;´,´asm´ or ´__attribute__´ before ´apr_off_t´ those errors occur like 30 times in different... (4 Replies)
Discussion started by: hjalle
4 Replies

7. UNIX for Advanced & Expert Users

Apache module & perl problem

I have a very strange problem that I can't seem to solve. I have apache module which filters content and within that module I will add some more content based on this calls: int check; check = system("/usr/bin/check"); check is a perl-script that exits with value 1 if the file doesn't... (2 Replies)
Discussion started by: hjalle
2 Replies

8. Solaris

Compile PHP as an Apache module on Solaris

Hi, I need to install php 5.5.30 as an apache (2.4.17) module on Solaris 10. Please any help is wellcome. Some aditional info: /usr/sfw/bin/gcc -v Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs bash-3.2# g++ -v Reading specs from... (0 Replies)
Discussion started by: lbslbs
0 Replies

9. Shell Programming and Scripting

Solaris install php as an apache module

Hi, I need to install php 5.5.30 as an apache (2.4.17) module on Solaris 10. Please any help is wellcome. Some aditional info: /usr/sfw/bin/gcc -v Reading specs from /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/specs bash-3.2# g++ -v Reading specs from... (1 Reply)
Discussion started by: lbslbs
1 Replies
CGI::Cookie(3pm)					 Perl Programmers Reference Guide					  CGI::Cookie(3pm)

NAME
CGI::Cookie - Interface to Netscape Cookies SYNOPSIS
use CGI qw/:standard/; use CGI::Cookie; # Create new cookies and send them $cookie1 = new CGI::Cookie(-name=>'ID',-value=>123456); $cookie2 = new CGI::Cookie(-name=>'preferences', -value=>{ font => Helvetica, size => 12 } ); print header(-cookie=>[$cookie1,$cookie2]); # fetch existing cookies %cookies = fetch CGI::Cookie; $id = $cookies{'ID'}->value; # create cookies returned from an external source %cookies = parse CGI::Cookie($ENV{COOKIE}); DESCRIPTION
CGI::Cookie is an interface to Netscape (HTTP/1.1) cookies, an innovation that allows Web servers to store persistent information on the browser's side of the connection. Although CGI::Cookie is intended to be used in conjunction with CGI.pm (and is in fact used by it inter- nally), you can use this module independently. For full information on cookies see http://www.ics.uci.edu/pub/ietf/http/rfc2109.txt USING CGI
::Cookie CGI::Cookie is object oriented. Each cookie object has a name and a value. The name is any scalar value. The value is any scalar or array value (associative arrays are also allowed). Cookies also have several optional attributes, including: 1. expiration date The expiration date tells the browser how long to hang on to the cookie. If the cookie specifies an expiration date in the future, the browser will store the cookie information in a disk file and return it to the server every time the user reconnects (until the expira- tion date is reached). If the cookie species an expiration date in the past, the browser will remove the cookie from the disk file. If the expiration date is not specified, the cookie will persist only until the user quits the browser. 2. domain This is a partial or complete domain name for which the cookie is valid. The browser will return the cookie to any host that matches the partial domain name. For example, if you specify a domain name of ".capricorn.com", then Netscape will return the cookie to Web servers running on any of the machines "www.capricorn.com", "ftp.capricorn.com", "feckless.capricorn.com", etc. Domain names must con- tain at least two periods to prevent attempts to match on top level domains like ".edu". If no domain is specified, then the browser will only return the cookie to servers on the host the cookie originated from. 3. path If you provide a cookie path attribute, the browser will check it against your script's URL before returning the cookie. For example, if you specify the path "/cgi-bin", then the cookie will be returned to each of the scripts "/cgi-bin/tally.pl", "/cgi-bin/order.pl", and "/cgi-bin/customer_service/complain.pl", but not to the script "/cgi-private/site_admin.pl". By default, the path is set to "/", so that all scripts at your site will receive the cookie. 4. secure flag If the "secure" attribute is set, the cookie will only be sent to your script if the CGI request is occurring on a secure channel, such as SSL. Creating New Cookies $c = new CGI::Cookie(-name => 'foo', -value => 'bar', -expires => '+3M', -domain => '.capricorn.com', -path => '/cgi-bin/database', -secure => 1 ); Create cookies from scratch with the new method. The -name and -value parameters are required. The name must be a scalar value. The value can be a scalar, an array reference, or a hash reference. (At some point in the future cookies will support one of the Perl object serialization protocols for full generality). -expires accepts any of the relative or absolute date formats recognized by CGI.pm, for example "+3M" for three months in the future. See CGI.pm's documentation for details. -domain points to a domain name or to a fully qualified host name. If not specified, the cookie will be returned only to the Web server that created it. -path points to a partial URL on the current server. The cookie will be returned to all URLs beginning with the specified path. If not specified, it defaults to '/', which returns the cookie to all pages at your site. -secure if set to a true value instructs the browser to return the cookie only when a cryptographic protocol is in use. Sending the Cookie to the Browser Within a CGI script you can send a cookie to the browser by creating one or more Set-Cookie: fields in the HTTP header. Here is a typical sequence: my $c = new CGI::Cookie(-name => 'foo', -value => ['bar','baz'], -expires => '+3M'); print "Set-Cookie: $c "; print "Content-Type: text/html "; To send more than one cookie, create several Set-Cookie: fields. Alternatively, you may concatenate the cookies together with "; " and send them in one field. If you are using CGI.pm, you send cookies by providing a -cookie argument to the header() method: print header(-cookie=>$c); Mod_perl users can set cookies using the request object's header_out() method: $r->header_out('Set-Cookie',$c); Internally, Cookie overloads the "" operator to call its as_string() method when incorporated into the HTTP header. as_string() turns the Cookie's internal representation into an RFC-compliant text representation. You may call as_string() yourself if you prefer: print "Set-Cookie: ",$c->as_string," "; Recovering Previous Cookies %cookies = fetch CGI::Cookie; fetch returns an associative array consisting of all cookies returned by the browser. The keys of the array are the cookie names. You can iterate through the cookies this way: %cookies = fetch CGI::Cookie; foreach (keys %cookies) { do_something($cookies{$_}); } In a scalar context, fetch() returns a hash reference, which may be more efficient if you are manipulating multiple cookies. CGI.pm uses the URL escaping methods to save and restore reserved characters in its cookies. If you are trying to retrieve a cookie set by a foreign server, this escaping method may trip you up. Use raw_fetch() instead, which has the same semantics as fetch(), but performs no unescaping. You may also retrieve cookies that were stored in some external form using the parse() class method: $COOKIES = `cat /usr/tmp/Cookie_stash`; %cookies = parse CGI::Cookie($COOKIES); Manipulating Cookies Cookie objects have a series of accessor methods to get and set cookie attributes. Each accessor has a similar syntax. Called without arguments, the accessor returns the current value of the attribute. Called with an argument, the accessor changes the attribute and returns its new value. name() Get or set the cookie's name. Example: $name = $c->name; $new_name = $c->name('fred'); value() Get or set the cookie's value. Example: $value = $c->value; @new_value = $c->value(['a','b','c','d']); value() is context sensitive. In a list context it will return the current value of the cookie as an array. In a scalar context it will return the first value of a multivalued cookie. domain() Get or set the cookie's domain. path() Get or set the cookie's path. expires() Get or set the cookie's expiration time. AUTHOR INFORMATION
Copyright 1997-1998, Lincoln D. Stein. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Address bug reports and comments to: lstein@cshl.org BUGS
This section intentionally left blank. SEE ALSO
CGI::Carp, CGI perl v5.8.0 2002-06-01 CGI::Cookie(3pm)
All times are GMT -4. The time now is 08:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy