Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6595355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:55:48+00:00 2026-05-25T17:55:48+00:00

I would like to detect if a user has cookies turned off and redirect

  • 0

I would like to detect if a user has cookies turned off and redirect them. Ideally I would like this to work throughout my site so that at any stage if the user turns cookies off they would be redirected to a page of my choice.

Who anyone have a idea of how to achieve this. I was thinking of creating a helper but I’m hoping there might be a neater simpler method of doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:55:48+00:00Added an answer on May 25, 2026 at 5:55 pm

    This is not as simple as it may first seem, because there are several aspects of your application that affect functionality here:

    1. What do you do when user first visits your root URL
    2. What to do when users get a link that is not root URL
    3. Can cookies be periodically checked

    Why do you need users to have cookies turned on? Please explain your business process maybe it this can be mitigated differently.

    Additional info

    You say you’re persisting user info using a cookie. This is basically the same as Session stores its Session ID. Inside a cookie. This is also the same as any forms authentication where upon login you store all or part of user information inside a cookie that gets accessed every time user makes a request.

    This makes it possible for you to use existing methods to achieve the same goal and not reinvent the wheel.

    1. Write a custom HttpModule

    Your module should be checking for that extra bit of information that you’d like to pass over each time your users make requests. If that data is not present you can redirect your user even before it gets to the application pipeline.

    But invest enough time to think out the whole process with all different possible executions like first access, turned off cookies, turning them off afterwards etc.

    2. Use cookies or/and Sessions

    By using Sessions you have to make sure that your module executes after session module otherwise session data will always be missing. Using just cookies won’t have this issue. But this heavily depends on the amount of data that you wish to preserve. If there’s too much of it (and is volatile) you should put some in session and just keep a handle in cookie that will get you to session data.

    A completely different cookie-less option

    A completely different option is a combination of Asp.net MVC routing and server persistence (Session/Cache/DB whatever).

    This is somehow similar to cookie-less sessions, but this time manually done with Asp.net MVC routing. Suppose this routing definition:

    routes.MapRoute(
        "Retention"
        "{handle}/{controller}/{action}/{id}",
        new { Controller = "Home", Action = "Index", Id = UrlParameter.Optional },
        new { Handle = "\d+" } // set your own constraint according to your needs
    );
    routes.MapRoute(
        "Default"
        "{controller}/{action}/{id}",
        new { Controller = "Home", Action = "Index", Id = UrlParameter.Optional }
    );
    

    This way you will keep your user persistence data handle in URL which will still work even though user would turn off cookies. To avoid failing sessions along with it you should persist data in some other storage.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to detect whether the user has pressed Enter using jQuery. How
I would like to detect (via c++) what the user has chosen for text
We have a scenario in which we like to detect when the user has
I would like to detect whether the OS I'm compiling on is Windows. Is
I would like to detect when a page load request give to a UIWebView
I would like to detect the following sequences: a aA aAa aAaA ... where
I have a JPanel, which I would like to detect the following events (1)
Using winforms in vs2008. I have a DataGridView and I would like to detect
I am creating a diagnostic page for ASP.NET and would like to programatically detect
I would like to be able to detect what country a visitor is from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.