[ic] Detect SSL or Non-SSL

Ron Phipps interchange-users@interchange.redhat.com
Thu Apr 25 03:47:00 2002


> From: interchange-users-admin@interchange.redhat.com
[mailto:interchange-
> users-admin@interchange.redhat.com] On Behalf Of Kevin Walsh
> 
> >
> > 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!
> >
> You could make use of a UserTag like this:
> 
>     UserTag is_secure Routine <<EOF
>     sub {
>         $CGI::secure =~ /^(on|1)$/i ? 1 : 0;
>     }
>     EOF
> 

Thank you, Kevin, Ed and Kyle for your code snippets.  All 3 worked as
desired and will come in handy for a project I'm working on.

Take it easy!
-Ron