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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:12:25+00:00 2026-06-13T17:12:25+00:00

My session cookie is somewhat long (about 700 bytes), since it contains various encrypted

  • 0

My session cookie is somewhat long (about 700 bytes), since it contains various encrypted user information and what not. There’s some things I can do to get that size down, and I’m working on that angle too, but that’s another topic.

My issue is that I don’t like how this cookie gets sent to the server on every single HTTP request; including requests to JPG images, CSS files, and static Javascript files. Since the cookie isn’t needed on these requests, I feel it might slow down page load times since this is 700 bytes x the number of resources the page loads. Obviously, these files get cached and what not but still I’d like my pages to load and quickly and smoothly as possible.

The one solution I can think of is to put all my static content on another sub-domain, such as cdn.myserver.com/images/ and cdn.myserver.com/scripts/, and set the cookie-path to only include www.myserver.com. I believe this would work, but it complicates dev and staging environments. I’d probably end up having to generate URLs dynamically depending on what environment the code was being run in.

My Question:

Besides the solution above, is there any way to prevent cookies from being sent across the wire for certain HTTP requests, such as image, script and style resources?

I’m running on the .NET stack, with IIS7.5 as a web server.

  • 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-06-13T17:12:27+00:00Added an answer on June 13, 2026 at 5:12 pm

    There isn’t anything you can do from a server perspective; by the time your server (IIS) or your framework (ASP.NET, or other) has received the request, the cookies have already been sent.

    What you mentioned will absolutely work, quoting RFC 2109 ("HTTP State Management Mechanism") (emphasis mine):

    Hosts names can be specified either as an IP address or a FQHN string. Sometimes we compare one host name with another. Host A’s name domain-matches host B’s if

    • both host names are IP addresses and their host name strings match exactly; or
    • both host names are FQDN strings and their host name strings match exactly; or
    • A is a FQDN string and has the form NB, where N is a non-empty name string, B has the form .B’, and B’ is a FQDN string. (So, x.y.com domain-matches .y.com but not y.com.)

    Note that domain-match is not a commutative operation: a.b.c.com domain-matches .c.com, but not the reverse.

    So creating a separate sub-domain, while specifically keying your cookies to a different sub-domain will work.

    Note that it’s commonly accepted practice to do this in order to increase page speed and Stack Overflow has been doing this since late 2009.

    In order to reduce the complexity of your staging and dev environments, I recommend following this lead; having the content on a separate domain means that you don’t have to do anything different for any of those environments.

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

Sidebar

Related Questions

i am using a session cookie (not a permanent one) to save the user
I am getting problem while setting up Session cookie using jersey. is there any
I am trying to reset the session cookie, and its life, when the user
I'm developing a web application using a cookie to store session information. I've manually
There is a session cookie with expiration time which says 'At end of session'.
http://www.javascriptkit.com/javatutors/cookie.shtml Session-only cookies, on the other hand, stores information in the browser memory, and
I'm confused about the EU Cookie law regarding third party session cookies. We're building
is there any reason (safety?) why someone should rename the ASP.NET Session Cookie Name
My log file has the message The session cookie data did not match what
Is the only way to use session cookie if I wanna keep a user

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.