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 4320774
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:40:12+00:00 2026-05-21T08:40:12+00:00

I have a folder in my webserver with some aspx pages that can only

  • 0

I have a folder in my webserver with some aspx pages that can only be accessed if a certain cookie exists.

On th page_load event i’m checking whether this cookie exists, if not redirect to Default.aspx. This works great with browsers such as Google Chorme and FireFox (3, I have not tested 2 yet). But… for some reason IE will send some sort of cookie still as my website thinks that there is a cookie available of some sorts..

So I added a button to my page to delete the cookie. but the cookie does not exist according to my code (which is correct). My assumption then was that IE caches the page. So after wiping the cache does my page code work properly and you get redirected to Default.aspx.

Is there some sort of way to deny access to the folder if that cookie does not exist, so that IE isn’t showing a page that doesn’t work?

It’s kind of hard to explain.

My cookie checking code is this:

protected void Page_Load(object sender, EventArgs e)
{
   {
      SimpleAES decrypt = new SimpleAES();
      //Check for Authentication Cookie
      HttpCookie auth_Cookie = new HttpCookie("WEB_AUTH");
      auth_Cookie = Request.Cookies["WEB_AUTH"];
      if (auth_Cookie != null)
      {
         //Some code to execute if Cookie exists and holds correct values
      }

      else
      { 
         //If there isn't a cookie, redirect to login.aspx
         Response.Redirect("~/Default.aspx"); 
      }
   }
}

Any help provided would be welcome!
Thanks

ADDED
I just want these pages in folder ‘XXX’ not be displayed if that cookie is not available. but IE loads the page from it’s local cache rather than check whether it can actually load this. What to do?

EDIT

The pages in the folder ‘XXX’ have 1 master page which is where the Cookie checking code resides in.

  • 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-21T08:40:13+00:00Added an answer on May 21, 2026 at 8:40 am

    You need to prevent browser from caching the page. You should set Response.Cache according to your requirements ( http://msdn.microsoft.com/en-us/library/system.web.httpresponse.cache(v=VS.100).aspx).

    Note that browser in theory can completely ignore your caching headers and load page from its own cache anyway, in practice all browsers respect caching headers.

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

Sidebar

Related Questions

I have a folder that contains 1000+ sub folders. In each subfolder there are
i have a folder having an html in a folder and javascript files, can
I have a folder in '/sites/all/libraries/folder'. In this folder some html files are automatically
When developing PHP applications it's common to have a public folder somewhere in the
I have one webserver (IIS) and in this I have two folders: website1 and
I have a web server that is running PHP 5.3.6 non thread safe (VC9),
I have a folder with a lot of XML Files. A bunch of them
I have shared folder on ubuntu/samba server of my network. I am running my
I have a folder c:\downloads\ffme and inside it there are loads of subfolders with
I have a main website app written in ASP.NET's MVC 3. Now, what I

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.