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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:52:21+00:00 2026-05-27T10:52:21+00:00

I need to read a cookie created on https://sub1.domain.com from http://origin.domain.com using ColdFusion. I’ve

  • 0

I need to read a cookie created on https://sub1.domain.com from http://origin.domain.com using ColdFusion. I’ve seen a lot of info about how to create a cookie in a subdomain using CFCOOKIE, but I don’t know how to access a cookie that already exists.

Will the HTTPS make this impossible anyway?

ADDENDUM:
The checked answer below correctly addresses the question as worded above. In my case, it did not work. I should have explained: The cookie on sub1.domain.com is created by a hosted third party product – not written in coldfusion and not under my control.

  • 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-27T10:52:21+00:00Added an answer on May 27, 2026 at 10:52 am

    This is really quite easy. When you create the cookie, give it a domain attribute equal to your domain. The important part to remember is that it MUST have a leading dot.

    <cfcookie name="mycookie" value="myvalue" domain=".mydomain.com" path="/" />
    

    The leading dot tells the browser to send the cookie to any subdomain of mydomain.com which would include sub.mydomain.com and blah.mydomain.com.

    You would then be able to access the cookie from any of the subdomains just as you would any other cookie:

    <cfset thevalue = cookie.mycookie />
    

    You should do this as a best practice to support older browsers.

    Here is the statement from RFC2109: HTTP State Management Mechanisms that could affect older browsers

    “To prevent possible security or privacy violations, a user agent
    rejects a cookie (shall not store its information) if… The value for
    the Domain attribute contains no embedded dots or does not start with
    a dot.”

    I believe this is overridden by RFC 2965: HTTP State Management Mechanism which states

    “Domain=value OPTIONAL. The value of the Domain attribute specifies
    the domain for which the cookie is valid. If an explicitly specified
    value does not start with a dot, the user agent supplies a leading
    dot.”

    Which explains why it might be working for you in, presumably, a modern browser. I would still suggest you add it.

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

Sidebar

Related Questions

I want to create a cookie using php,an also i need to read it
I need to send more than a Set-Cookie HTTP header using HttpWebRequest class. Problem
I need to read some values from cookie or session when I am executing
I need to read from a variety of different text files (I've some delimited
I need to read selected files, matching on the file name, from a remote
I need to read account number from Maestro/Mastercard with smart card reader. I am
I need to read data added to the end of an executable from within
I need to read the value of a property from a file in an
I need to read the user's fingerprint from my application. What I really want
I read http://code.google.com/speed/page-speed/docs/caching.html . It says that proxy servers may cache cookies. I need

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.