i've run into an interesting ... side effect of using mod_rewrite and Apache::Session::File. an app that gets redirected via the RewriteEngine seems to lose its POST information ...

the backstory:
an application has a few steps to it, but doesn't *need* to be run through SSL until the final step, a credit card charge. now i suspect i could use GET, but i really don't want to be passing a credit card number in the GET string. it's just bad practice.

i grabbed a bit of Rewrite Rules from the FAQ for mod_ssl (http://httpd.apache.org/docs-2.1/ssl/ssl_faq.html):

RewriteEngine on RewriteRule ^/(.*):SSL$ https://%{SERVER_NAME}/$1 [R,L] RewriteRule ^/(.*):NOSSL$ http://%{SERVER_NAME}/$1 [R,L]
and in the step where the creditcard is POSTed, i've changed the action to: <form name='checkout' method='POST' action='/order/fliers.cgi:SSL'>

URL redirection works like a champ, but a new session_id is generated, and the application ends up back on the first page .... which ... well, defeats the purpose.

before i make the whole app run through SSL (which isn't that big of a deal) is there a way to preserve the POST information across RewriteRules? or is something else going on here (like the SessionFile being tied to an IP:port pair?


In reply to Apache::Session::File and mod_rewrite by geektron

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.