Gossamer Forum
Home : General : Internet Technologies :

setting a cookie for redirect?

Quote Reply
setting a cookie for redirect?
Hi there.

Wondering if anyone has thoughts about how I might solve this problem:

I've got two versions of an index page - one for regular visitors and another for members, who are authenticated by an .htaccess file. When a member logs in, he goes to the members index page. But then, though the course of navigating through the site, it's likely he may end up back at the regular index page.

Is there a way I can set a cookie - with either javascript or PHP preferably - so that once someone logs in, for the next 3 hours (or whatever), anytime they visit the regular index they're automatically redirected to the members index?

Maybe a cookie isn't the way to do this, but it's all I can think of.

Thanks in advance for any advice or assistance.

Adam

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [adamuforestasan] setting a cookie for redirect? In reply to
What are you most familiar with? Javascript, Perl PHP? It should be a preety sraightforward check.

- wil
Quote Reply
Re: [Wil] setting a cookie for redirect? In reply to
Thanks for the reply.

I'm familiar with all three, though really nothing more than a novice at any. I mentioned PHP because the pages themselves are PHP generated, and javascript because I know that's how most cookies are set. I figured the fact that the pages were index.php would make perl difficult to use, but then again, what do I know?

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [adamuforestasan] setting a cookie for redirect? In reply to
If you're familiar with PHP then I would suggest you looking into the setcookie() function. You can then incoporate this into your index.php page:

http://www.php.net/...nction.setcookie.php

- wil
Quote Reply
Re: [Wil] setting a cookie for redirect? In reply to
Thanks for the pointer.

I also found this:

http://javascript.internet.com/...cookie-redirect.html

Which I might be able to customize to fit my needs.

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund