htaccess Elite

.htaccess tutorial


All times are UTC [ DST ]





Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: reading session vars in .htaccess (for folder security)
PostPosted: 10 Mar 2008 12:52 
Offline

Joined: 10 Mar 2008 12:47
Posts: 1
Hi,
I'm wondering if it's possible to protect certain folders by session vars. So access should be granted if i.e. username/securitylevel is set, otherwise user should be redirected to an error page.
Anyone an idea how to solve this?

Best regards,

Stelli


Top
 Profile  
 
 Post subject: Re: reading session vars in .htaccess (for folder security)
PostPosted: 26 Mar 2008 19:36 
Offline

Joined: 28 Feb 2007 17:16
Posts: 40
stelli wrote:
I'm wondering if it's possible to protect certain folders by session vars. So access should be granted if i.e. username/securitylevel is set, otherwise user should be redirected to an error page.


Sure, if you use it like a cookie.

Put something like this in a folder and it can only be accessed by a HTTP request containing a cookie with LOGGEDIN=2047980357
Code:
RewriteEngine On
RewriteCond %{HTTP_COOKIE} !^.*LOGGEDIN=([0-9]+).* [NC]
RewriteRule .* - [F,L]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB