Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > logic behid URLReferrer expression View modes: 
User avatar
Member
Member
Dmitriy.Kiriyak-tui - 6/11/2013 10:36:17 AM
   
logic behid URLReferrer expression
Hi all!
I've read previous posts about this macro expression, but I'm not a developer (especially, not a .NET developer), so I don't really understand everything what it says :)
I thought the URLReferrer experssion should return the page where the visitor found the link to my page and followed the link, but it seems to me that it doesn't as the expression returned pages, where my link didn't exist, but which I visited recently.
So please, in two words, could you explain the logic behid this macro?
I'd be very grateful!

User avatar
Kentico Support
Kentico Support
kentico_filipl - 6/13/2013 2:17:34 AM
   
RE:logic behid URLReferrer expression
Hi Dmitriy,

The {%URLReferrer%} macro returns the value of HttpContext.Current.Request.UrlReferrer property that is set during the Session_Start event. However, it is set when the session is being created, meaning only on the first user's request. So if the user requested the first page of your site directly, this macro returns an empty string.

Best regards,
Filip Ligac

User avatar
Member
Member
Dmitriy.Kiriyak-tui - 6/14/2013 6:22:14 AM
   
RE:logic behid URLReferrer expression
I see. Thank!
I just need a way of hiding a certain page for everyone, except for those, who come from a specific referrer. I thought URLReferrer could help me with this. Maybe you know the right way of doing this, without needing an access to files and servers? I have only the rights of global admin.
I'd be very thankful and happy, if there was a way :)

User avatar
Kentico Support
Kentico Support
kentico_filipl - 6/14/2013 7:08:51 AM
   
RE:logic behid URLReferrer expression
Hi Dmitriy,

Functionality you require cannot be achieved without access to project files because it requires some code customizations using URLReferrer macro and also dynamic setting of permissions (deny read) of certain site documents to the newly created role which would represent users who came to the site from that specific domain.

Best regards,
Filip Ligac