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

  • Home
  • SEARCH
  • 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 6935447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:06:15+00:00 2026-05-27T12:06:15+00:00

My application is in Asp.Net MVC3, i have two Users(Admin and general).Im maintaining the

  • 0

My application is in Asp.Net MVC3, i have two Users(Admin and general).Im maintaining the cookies of the Logged In users.

Below is my Cookie code.

 public static void setCookiestring Password ,string UserName)
 {
     HttpCookie MyCookie= new HttpCookie("MyCookies");
     MyCookie["Password"] = Password;
     MyCookie["UserName"] = UserName;
     MyCookie.Expires.Add(new TimeSpan(0,30,0));
     HttpContext.Current.Response.Cookies.Add(MyCookies);
 }

Below is code of how my cookie Expires when user Logs Out

public static bool logout()
        {
            HttpCookie MyCookie= new HttpCookie("MyCookies");

            MyCookie.Expires = DateTime.UtcNow.AddDays(-1);
            HttpContext.Current.Response.Cookies.Add(MyCookies);
            return true;
        }

I have tried to check the Cookie on every Index() of Controller.If the Cookie exists it should navigate to desired page else it should go to Home.

 if (!Cookie.CheckCookie())
    {
       //use the current url for the redirect       
       filterContext.HttpContext.Response.Redirect("~/Home/Index", true);
    } 

When the user clicks Log Out they are Redirected to Home,but after clicking Back button,the last visited page is can be viewed.
What can i do so that when the user clicks on LogOut and if they click back button they should still get Redirected to Home and not to Last Visited Page.
Please Suggest

  • 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-27T12:06:16+00:00Added an answer on May 27, 2026 at 12:06 pm

    One way to prevent this is to exclude all authenticated pages from being cached on the client side by setting the appropriate response headers. You may take a look at the following post for an example of an action filter that you could apply to the authenticated part of your site.

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

Sidebar

Related Questions

I have a asp.net MVC3 Application with two users Admin and General.Cookies is saved
In my ASP.NET MVC 3 application i have two types of users - regular
My application is in Asp.Net MVC3 coded in C#.Net. I have Views which contains
I have working application in asp.net MVC3. Today when I was working on it
I have been developing an application in asp.net mvc3. We have used models to
I have an ASP.NET MVC3 application in which I am creating multiple areas, is
I am building an asp.net mvc3 application and I have decided to use areas
Here's the issue at hand: I have developed an ASP.NET MVC3 application using Razor.
I'm writing an ASP.net MVC3 application using Entity Framework Code First and SqlCe4. I
I have the following WebGrid in my ASP.NET MVC3 test application. It displays a

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.