Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8062979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:51:50+00:00 2026-06-05T10:51:50+00:00

We have a scenario where we are using a rewrite rule condition in Apache

  • 0

We have a scenario where we are using a rewrite rule condition in Apache 2.2’s httpd.conf to take a parameter from the query string, and write it as a Cookie:

CustomLog "/www/apache/ndipiazza/logs/ssl_request_log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b \"%{Cookie}i\""

RewriteEngine On
RewriteCond %{QUERY_STRING} CID=(.*)
RewriteRule .* - [L,CO=COOKIE_CID:%1:ndipiazza-local.com:50000] 

So for example, The URL “http://ndipiazza-local/mypage.jsp?CID=NickDogg” Creates a cookie “COOKIE_CID = NickDogg”

However, we can’t quite use this solution because we have a restriction that we cannot store this cookie as clear-text. As of now, it writes in the log as clear text, and it writes the cookie as clear text. We need to encode it.

Is there a way to make apache encode the cookie being stored?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:51:51+00:00Added an answer on June 5, 2026 at 10:51 am

    Yes there is a way to do this.

    For this you want to use a RewriteMap with MapType “prg”.

    So you would define a RewriteMap like

    RewriteEngine On 
    RewriteMap encode-map prg:/path/to/encode_script 
    RewriteCond %{QUERY_STRING} UID=(.*) 
    RewriteRule .* - [L, CO=COOKIE_CID:${encode-map:%1}:ndipiazza-local.com:50000] 
    

    The /path/to/encode_script is a script on your system that is started once when apache starts and then gets newline terminated strings to encode and has to output newline encoded strings WITHOUT stdout buffering.

    For further information and examples look at section “External Rewriting Program” on http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html and the “prg” examples on http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide.html and http://httpd.apache.org/docs/2.0/rewrite/rewrite_guide_advanced.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scenario where I need to search from many binary files (using
I have a scenario in which I have to query an excel sheet using
I have a scenario. Can this be done using one query ? Table Company
I am building a page using string builder methods etc. I have a scenario
The Scenario Using jQuery, I have a page that has a popup overlay containing
I have scenario, in which I am getting images using Web Service and all
I have a scenario where I am using Google Map JavaScript API to process
I have a scenario where I am to send email using our own SMTP
I have this scenario where I would like to redirect my domains using the
I have a scenario that when I try to access a hash key using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.