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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:22:49+00:00 2026-05-24T10:22:49+00:00

I am pretty new to this cookie stuff. I have a requirement where I

  • 0

I am pretty new to this cookie stuff. I have a requirement where I need to set a cookie on the TLD (www.example.co.uk) from one of the subdomains (sub.example.co.uk) using Javascript. First of all, is it possible? if yes, how do I go about doing that? Any help on this would be highly appreciated.

Thanks,
L

  • 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-24T10:22:50+00:00Added an answer on May 24, 2026 at 10:22 am

    I think you are confused about the definition of a TLD. You cannot set a cookie on a TLD. You can try to set a cookie on a different domain, but the browser may or may not accept it (look into the P3P header). I would set it in a shared domain. In your example, it would be .example.co.uk and would work for http://www.example.co.uk and sub.example.co.uk.

    Try this (untested):

    document.cookie = "name=value; expires=date; path=path; domain=.example.co.uk";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm pretty new to this stuff and I need your help. I should build
I am pretty new to this iPhone dev thing but so far I have
i am pretty new to all this Monodroid stuff. I am porting my Windows
Im still pretty new so bear with me on this one, my question(s) are
I'm pretty new in iphone programming and have stumbled upon this issue which I
Since I'm pretty new this question'll certainly sound stupid but I have no idea
I'm pretty new at this iphone dev stuff and i'm working on some existing
I am pretty new at this stuff, so bear with me. I am using
I have a problem in wpf xaml and i'm pretty new on this so
Hi (I'm pretty new to this), I have created a portal where the 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.