[ic] Detect SSL or Non-SSL

Kyle Cook interchange-users@interchange.redhat.com
Thu Apr 25 00:22:01 2002


At 07:50 PM 4/24/02, you wrote:
>Using IC tags is there a way to detect if the page has been served in
>SSL or non-ssl mode?  With javascript you can do:
>
>if (document.location.protocol == "http:")
>
>But I would like to avoid using javascript if possible.  Thanks!
>
>-Ron

Ron,

One way to find out is in a usertag:

UserTag is_secure Routine <<EOR
sub {
return $CGI::secure;
}
EOR

(I believe the value will be either "on" or "" )

There maybe other ways, but I had need in a usertag
at one point (back in mv days I think) and found
  $CGI::secure in the source , so used it myself :-)

Kyle Cook