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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:12:29+00:00 2026-05-29T09:12:29+00:00

I am breaking my head to figure out a browser specific issue (in Firefox

  • 0

I am breaking my head to figure out a browser specific issue (in Firefox and Chrome). I have spent so much time to try fixing this issue that I have finally thought to create a live demo for the experts here to look into this issue. (Hopefully it pays off)

I have two domains http://www.nkmekal.com and http://www.incessantcoding.com

Please use Firefox/Chrome to replicate the issue:

Step 1:

Browse http://www.nkmekal.com/createcookie.aspx

The page just creates a cookie. Below is the code that creates the cookie:

    // In On_Load of nkmekal.com/createCookie.aspx
    HttpCookie cookie = new HttpCookie("DisCookie");
    cookie.Value = "djdjd77676ydjdndgdidjkdnhf";
    cookie.HttpOnly = true;
    cookie.Expires = DateTime.Now.AddDays(1);
    Response.Cookies.Add(cookie);
    lblCookieInfo.Text = string.Format("<b>Cookie Name:</b> {0} <br/><br/> <b>Cookie Value:</b> {1} <br/><br/> <b>Cookie Expires On:</b> {2}", cookie.Name, cookie.Value, cookie.Expires);

Step 2:

Now open a new tab in the browser, go to http://www.incessantcoding.com/GoTonkmekal.aspx which basically does a simple 302 redirect to http://www.nkmekal.com/ReadCookie.aspx , below is the code that does this redirect:

// In On_Load of incessantcoding.com/GoTonkmekal.aspx
protected void Page_Load(object sender, EventArgs e)
{
    Response.Redirect("http://www.nkmekal.com/ReadCookie.aspx");
}

However I see the below message: (Please see the code of ReadCookie.aspx page in Step 3)

“No Cookie Found :(”

Which means that the domain http://www.nkmekal.com was unable to read the cookie that it created earlier when you’ve browsed http://www.nkmekal.com/createcookie.aspx

Step 3:

And the page http://www.nkmekal.com/ReadCookie.aspx just tries to read the above created cookie (in Step 1) and displays cookie data. Below is the code that tries to read the cookie and displays it in the page

    // In On_Load of nkmekal/ReadCookie.aspx
    HttpCookie cookie = Request.Cookies["DisCookie"];
    if (cookie != null)
    {
      // Resetting expiry date because the browser never sends expiry date to Server,
      // as cookies expiration dates are irrelevant to servers.
      cookie.Expires = DateTime.Now.AddDays(1);
      lblCookieInfo.Text = string.Format("<b>Yes! I found a cookie</b> <br><br><b>Cookie Name:</b> {0} <br/><br/> <b>Cookie Value:</b> {1} <br/><br/> <b>Cookie Expires On:</b> {2}", cookie.Name, cookie.Value, cookie.Expires);
    }
    else
    {
        lblCookieInfo.Text = "No Cookie Found :(";
    }

The above steps work fine only in IE but not in FireFox/Chrome.

Also, if you want to take a peek at the source code of the two domains you can download them at

http://dl.dropbox.com/u/1248159/incessantcoding.zip

http://dl.dropbox.com/u/1248159/nkmekal.zip

Why am I trying to do this:

So, the reason why I am trying to do this is that there are certain operations that I need to perform in the domain http://www.incessantcoding.com if there was a cookie created in http://www.nkmekal.com

And the reason for going with a 302 redirect is that we cannot read cross domain cookies and hence I am trying to get the cookies read from the appropriate domain only (since nkmekal.com can only read its cookies).

Any help/suggestions will be very helpful.

Update:
Also quite interestingly, if steps 1 and 3 are performed (leaving out step 2), the cookie value is read in Firefox and Chrome correctly. Its only the 302 way that isn’t working.

  • 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-29T09:12:30+00:00Added an answer on May 29, 2026 at 9:12 am

    I have finally figured out an alternative and it works just fine!
    Here is what I’ve did:

    If nkmekal.com creates a DisCookie…I am issueing a 302 redirect to incesscantcoding.com with an encrypted token as a querystring value, then incessentcoding.com will create its own DisCookie based on the querystring value for its domain, so if I want to know if a cookie exists for nkmekal.com I will just look at the Cookies collection for a DisCookie in incessantcoding.com … I tested this scenario and it seems to be working in both firefox and chrome…

    AND later I figured that even google does similar thing when a user logs into one of their service websites…

    Hope this helps…

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

Sidebar

Related Questions

I'm breaking my head trying to figure out how to do this right, I
I am breaking my head to fix an issue. I have a method that
I have been breaking my head for 3 hours now and I can't figure
Alright, I have been breaking my head over this one for more than a
I'm using Cassandra 0.7.4. I have been breaking my head for most of today
Im breaking my head against the table right now. I have a flash batch
Breaking my head against more compex problems, I try to get back to basics.
I am breaking my head over this issue. I did find something on the
I have been breaking my head over this hope it's possible declare @locationType varchar(50);
I'm breaking my head over this for a while now and I have no

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.