DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Show/Hide DNN Menu item based on cookie set

 2 Replies
 1 Subscribed to this topic
 40 Subscribed to this forum
Sort:
Author
Messages
Pat
New Around Here
Posts: 0
New Around Here

In my site guest users are able to view pages without login. 

We are storing user type in cookie selected by users from one form when they visit site first time. Now based on that user type we would like to show/hide some pages from menu. Can you please suggest how we can achive that?

Veteran Member
Posts: 1246
Veteran Member
MVP
MVP
You're an MVP!
Do you want to hide the pages from navigation, or do you want to prevent users from seeing pages?
Growing Member
Posts: 80
Growing Member
Hi Pat, I think there are probably a small number of ways to approach this. Can your users be put into categories, like Customers or Prospects? Because DNN has a strong "Roles" based user management system that can be used to make pages visible or hidden depending upon the roles they are in. To make that work, your visitors would have to be users in the DNN site. Can you prompt them for a username and password? That would log them in and they would then benefit from the custom page sets based upon their roles.

If logging them with user action is not an option, you could auto-log them in to one of several standard user accounts that already have the roles assigned. The process would grab your cookie and use it to auto login to the right DNN user account.

Be aware that users can delete their cookies. Would that mess you up?

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved