Hi all,
first time here, and having difficulty finding my way around. I have searched every term
I can think of, but gotten nowhere.
What I’m looking for is the simple variables or cookies to check whether a web user is logged
in. Would someone please post them?
I want to restrict access to a directory to only logged-in members, and am struggling with the
.htaccess, which has always been a weak point. I’ve got to the point of sending users to a log-in
page, but can’t find how to check variables.
many thanks in advance,
Duncan
Thanks for your response, yes, I’m using revolution, the version info says "rev 6066". and thanks for the tip re search, difficult to find complete documentation for a beginner.
I was trying to restrict access to a /directory/ based on whether or not the user was logged in. This is how I ended up doing it, in .htaccess;
<code>
# Cookie Directory Protection
RewriteCond %{REQUEST_URI} ^/pdfs/(.*)$
RewriteCond %{HTTP_COOKIE} !SN4c56177e7b9f6=([^;]+) [NC]
#RewriteCond %{HTTP_COOKIE} !WebLoginPE=([^;]+) [NC]
RewriteRule . /member-check.html [L]
</code>
I couldn’t find a better way to check whether the user is logged in than the site’s cookie name, SN4c56177e7b9f6.
Member-check is an adapted version of the webloginpe snippet. I’ve also fiddled with that .class.php file to direct a user to the pdf once logged in, instead of the to the front page.
The above is probably a hideous mess, but I’m a mod-x beginner, and had deadline pressure.
cheers,
Duncan