in reply to SSI and *reading* a cookie only
How complicated does your cookie check need to be? If HTTP_COOKIE is set in your enviroment you can check to see if something is set like this:
<!--#if expr="$HTTP_COOKIE = /foo\=bar/"--> <p>Cookie foo is set to bar</p> <!--#endif -->
If you need something more complicated you could use exec or virtual to run a cgi.
foo.shtml
<html> <body> <p>Test of include</p> <!--#include virtual="/cgi-bin/bar.pl" --> </body> </html>
bar.pl
#!/usr/bin/perl -w use strict; use CGI; my $cgi = CGI->new(); print $cgi->header, $cgi->start_html; my @names = $cgi->cookie(); foreach my $c ( @names ) { my $val = $cgi->cookie( $c ); print $cgi->blockquote( $cgi->em( $c ), ' - ', $val ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: SSI and *reading* a cookie only
by jfrm (Monk) on Jun 17, 2005 at 20:43 UTC |