Set Cookie via Rewrite Rules

Discussion in 'Feedback/Feature Requests' started by Atticus, Jul 5, 2011.

  1. Atticus

    Atticus New Member

    Hi there,

    Not sure if this would be considered a bug or a feature request, but to offer the benefit of the doubt we'll go with feature request :)

    In the mod_rewrite documentation for Apache 2.2 there is support for setting cookies using rewrite rules. [see http://httpd.apache.org/docs/current/rewrite/flags.html#flag_co]

    Our load balanced environment is causing problems for some automated update system (e.g. Wordpress, Drupal) and enabling session persistence would likely solve the issues we have been experiencing. The easiest way I can think of doing this is by setting a cookie whenever the viewer is accessing, for instance, http://mydomain.com/wp-admin/. In Apache, the following RewriteRule should spit out a cookie to the viewer which will trigger the session persistence --

    RewriteRule ^/wp-admin/index\.php - [CO=wp_sptrack:true:.mydomain.net:0:/:0:1]

    No matter how I try it this feature doesn't work. Assuming I am correct, would it be possible to add its support to Litespeed's rewrite system? If I am doing it wrong, any idea why?

    Thanks for your time!
  2. mistwang

    mistwang LiteSpeed Staff

    We will add that feature in later release.
    I think the best solution is to get a session aware LB, like our LSLB product.
  3. Atticus

    Atticus New Member

    Our load balancer is session aware, but if you're logged into the ACP of a product that session might not be removed after you've left the ACP. That's why we're looking to go this alternate route.
  4. mistwang

    mistwang LiteSpeed Staff

    This feature has been added to 4.1.2 release.

Share This Page