Forum Moderators: phranque

Message Too Old, No Replies

using mod rewrite for cookie auth

         

chx1975

5:38 am on Jul 10, 2008 (gmt 0)

10+ Year Member



I have many developer subdomains and I thought I could save a lot of basic auth password enterings by using something like:


RewriteEngine On
RewriteCond %{HTTP:Authorization} "^Basic dGVzdDp0ZXN0$"
RewriteRule ^ - [co=test:test:localhost:3600:/] [L]

RewriteCond %{HTTP:Authorization} "!^Basic dGVzdDp0ZXN0$"
RewriteCond %{HTTP_COOKIE} !^test=test$
RewriteRule ^ - [R=401,L]
Header always set WWW-Authenticate 'Basic realm="dev"'

Do you think this is safe?