Redirect login cache problem.

Permalink
Hi
I'm using a page attribute for redirection when a user is logged in.
I'm now trying to redirect a specific group to a specific page. So I set a page attribute to the page where all users are redirected to when login.
Then in header.php
$user = new User();
if ($user->inGroup(Group::getByName('Bokning'))) {
   $redirectURL = $c->getCollectionAttributeValue('redirect_to_url_bokning');
   if ($redirectURL != '') {   
      Header( "HTTP/1.1 301 Moved Permanently" ); 
      Header( "Location: " . $redirectURL ); 
   }
}


This seems to work ok if I login with Group "Bokning" I am sent to the right place.

Now if I log out and login as a different user in a different group and click the link to the page with the page attribute. I am directed to the "Bokning" page. Wich is wrong. If I clear browsers cache. Problem is gone.

I have tried to clear the cache in various places. But it does not work.
I have to use the browsers "clear cache".

How can I do this the best way?

Regards
Olle

 
SVijay replied on at Permalink Reply
SVijay
Hi,

I am not sure whether it works or not just try it.

clear the cache before executing redirect code

To know how to clear the cache, visit the given link

http://www.concrete5.org/documentation/developers/system/caching...

Good luck !!!
olleka replied on at Permalink Reply
Thank you. What i did now was to do anothre "if" so that if the user is not in that group it gets another redirect attribute. Seems to work for now.

Regards
Olle