Forum Moderators: phranque

Message Too Old, No Replies

.htaccess and cookie help

I am trying to check the cookie using .htaccess

         

AjiNIMC

10:00 am on Dec 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi to all,

Please help me with this, I am trying to check the phpbb cookie with .htaccess.

If logged in then get the content from from /members/index.html else show the normal page.

Logged out cookie
phpbb2mysql_data
a%3A0%3A%7B%7D
domain.com/
1536
2669574528
29828907
2051713328
29755482
*

Logged in cookie
phpbb2mysql_data
a%3A2%3A%7Bs%3A11%3A%22autologinid%22%3Bs%3A32%3A%22231f009004ef61cee94304a5b0f4f052
%22%3Bs%3A6%3A%22userid%22%3Bs%3A2%3A%2246%22%3B%7D
domain.com/
1536
3479574528
29828907
2849993328
29755482
*

My .htaccess
RewriteEngine on
RewriteCond %{HTTP_COOKIE} ([[:print:]])userid([[:print:]])
RewriteRule ^(.*)$ /members/index.html [L]

The sad part is, it is not working :( . Please help me make it work.

Please let me know if any info is required.

Thanks,
AjiNIMC

[edited by: jdMorgan at 4:14 pm (utc) on Dec. 24, 2005]
[edit reason] Fixed side-scroll [/edit]

jdMorgan

4:17 pm on Dec 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, we need to know which parts of the cookie string are fixed, which parts vary, which parts mean the user is logged in, and which parts should be ignored for the purpose of selecting the proper content, in detail.

Jim

AjiNIMC

5:56 pm on Dec 24, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just need to check whether the "userid" variable exists or not , if it exists, I will redirect to members area and then the php will handle the rest of the section.

it is working fine, as in I am able to check the cookie properly. only problem is that I am not able to get the content from the members page for all the requested pages.

my other post is somehow now a bit related. I will chekc back after Christmas.

Thanks again
AjiNIMC