473,480 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to Write into a Cross-Subdomain Cookie

Hello and sorry for my english, I'm italian...

I manage a site with a normal address like: www.mysite.com
I'm using a cookie to store nicks of my users, with a code like this:
----
Response.Cookies("mycookie").Expires = #January 1, 2030#
Response.Cookies("mycookie").Path = ""
Response.Cookies("mycookie").Secure = FALSE
Response.Cookies("mycookie")("nick") = nick
----

and I'm deleting it, if a user wants so, with:
----
Response.Cookies("mycookie").Expires = #January 1, 2003#
Response.Cookies("mycookie").Path = ""
Response.Cookies("mycookie").Secure = FALSE
Response.Cookies("mycookie")("nick") = ""
Response.Cookies("mycookie") = ""
----
(I know, there's too much stuff in the delete procedure!)

Now I'm going to open some new sections of my site, with subdomain
adresses, like search.mysite.com, shop.mysite.com... and I need that
cookie authentication for the main (www) address is working also in
these subdomains.

I red on the Internet that with the DOMAIN property, I can set my
cookie to make it work for every subdomain, with something like:
----
Response.cookies("mycookie").domain = ".mysite.com"
----

.... and it works!
My problem is when I try to DELETE it: after I set a cookie with
..domain property, it seems to become "read only": any my attempt to
delete (or modify) it seems to be ignored.

Results are the same when I try to write it from the subdomain that
created it (www), or when I try from the "chief" address (mysite.com,
without any subdomain).

Where's my mistake?

Thanks everybody in advance.

Oct 25 '06 #1
2 10189
flip79 wrote:
Hello and sorry for my english, I'm italian...

I manage a site with a normal address like: www.mysite.com
I'm using a cookie to store nicks of my users, with a code like this:
----
Response.Cookies("mycookie").Expires = #January 1, 2030#
Response.Cookies("mycookie").Path = ""
Response.Cookies("mycookie").Secure = FALSE
Response.Cookies("mycookie")("nick") = nick
----

and I'm deleting it, if a user wants so, with:
----
Response.Cookies("mycookie").Expires = #January 1, 2003#
Response.Cookies("mycookie").Path = ""
Response.Cookies("mycookie").Secure = FALSE
Response.Cookies("mycookie")("nick") = ""
Response.Cookies("mycookie") = ""
----
(I know, there's too much stuff in the delete procedure!)

Now I'm going to open some new sections of my site, with subdomain
adresses, like search.mysite.com, shop.mysite.com... and I need that
cookie authentication for the main (www) address is working also in
these subdomains.

I red on the Internet that with the DOMAIN property, I can set my
cookie to make it work for every subdomain, with something like:
----
Response.cookies("mycookie").domain = ".mysite.com"
----

... and it works!
My problem is when I try to DELETE it: after I set a cookie with
.domain property, it seems to become "read only": any my attempt to
delete (or modify) it seems to be ignored.

Results are the same when I try to write it from the subdomain that
created it (www), or when I try from the "chief" address (mysite.com,
without any subdomain).

Where's my mistake?

Thanks everybody in advance.
Can't nobody answer? Please help me, I'm still on this problem :(

Oct 26 '06 #2

"flip79" <fl****@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hello and sorry for my english, I'm italian...

I manage a site with a normal address like: www.mysite.com
I'm using a cookie to store nicks of my users, with a code like this:
----
Response.Cookies("mycookie").Expires = #January 1, 2030#
Response.Cookies("mycookie").Path = ""
Response.Cookies("mycookie").Secure = FALSE
Response.Cookies("mycookie")("nick") = nick
----

and I'm deleting it, if a user wants so, with:
----
Response.Cookies("mycookie").Expires = #January 1, 2003#
Response.Cookies("mycookie").Path = ""
Response.Cookies("mycookie").Secure = FALSE
Response.Cookies("mycookie")("nick") = ""
Response.Cookies("mycookie") = ""
----
(I know, there's too much stuff in the delete procedure!)

Now I'm going to open some new sections of my site, with subdomain
adresses, like search.mysite.com, shop.mysite.com... and I need that
cookie authentication for the main (www) address is working also in
these subdomains.

I red on the Internet that with the DOMAIN property, I can set my
cookie to make it work for every subdomain, with something like:
----
Response.cookies("mycookie").domain = ".mysite.com"
----

... and it works!
My problem is when I try to DELETE it: after I set a cookie with
.domain property, it seems to become "read only": any my attempt to
delete (or modify) it seems to be ignored.

Results are the same when I try to write it from the subdomain that
created it (www), or when I try from the "chief" address (mysite.com,
without any subdomain).

Where's my mistake?
Exact code you are using to create the cookie and exact code you are using
to delete it would help.

My guess is that you aren't using .domain = ".mysite.com" when deleting it.

Thanks everybody in advance.

Oct 26 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2030
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
5
3285
by: MiLF | last post by:
Is it possible to write a Audio CD Player by using python only?
5
8695
by: silviu | last post by:
Hi All, I have to write C++ code (server code) that will compile/run on both Windwos and Linux OS's. Could someone give me some pointers to info on this matter. Thanks in advance for your...
9
6309
by: James Marshall | last post by:
I'm writing a library where I want to override document.write(), but for all document objects; thus, I want to put it in the prototype. I tried Document.prototype.write= my_doc_write ; but it...
0
1858
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
13
9580
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be...
23
6477
by: Jeff Rodriguez | last post by:
Here's what I want do: Have a main daemon which starts up several threads in a Boss-Queue structure. From those threads, I want them all to sit and watch a queue. Once an entry goes into the...
8
9393
by: '69 Camaro | last post by:
Perhaps I'm Googling for the wrong terms. Does anyone have links to examples of the syntax necessary to read the HTML on another Web page when that HTML is produced from JavaScript using the...
20
2993
by: _mario.lat | last post by:
hallo, I use PHP and I'd like to not write in hardcoded way password and login to access to mysql. how to not write password in code for access to mysql? How can I do? I'd like that who see my...
6
3963
by: ampo | last post by:
Hello. Can anyone help with cross-domain problem? I have HTML page from server1 that send xmlHTTPRequest to server2. How can I do it? Thanks.
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6918
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7057
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5357
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4495
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3008
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.