Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Federico Daniel Castellano 1 post 71 karma points
    Jan 30, 2021 @ 00:18
    Federico Daniel Castellano
    0

    Lading only one time with Cockies

    Hello everyone. I am developing a new site in Umbraco 8.

    I need to implement a landing page that allows the user to choose between 2 options. (I am an expert, I am not an expert). When the user chooses an option, it stores the selection and some cookie and redirects it to the home page.

    The next time the user enters, the cookie should be checked and if it exists, redirect it to the corresponding option.

    On the Home page there should be a button that allows the user to change the option that causes the cookie changes.

    Any idea how to approach this?

    Thanks

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Feb 03, 2021 @ 07:23
    Søren Kottal
    0

    Should all requests to your site redirect to the selection page if no cookie exists?

    Then you could replace the default RenderMvcController with your own, where you check for the existence of the cookie, and redirect to the selection page if needed.

    https://our.umbraco.com/Documentation/Reference/routing/custom-controllers#replace-umbracos-default-rendermvccontroller

Please Sign in or register to post replies

Write your reply to:

Draft