473,507 Members | 4,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can cookie be shared in 2 sites in this way ??


I just worte code in this way in my login.htm with javascript,
login.htm resides in websitea

document.cookie ='Data=' + escape(AccountStr + "|" + CheckStr +
"|" + IndexStr + "|" + AccountType + "|") + "; expires=" + expire
s.toGMTString()+' Path=/ ;' +"Domain=www.websiteb";

my goal is to share user's loginfo between websitea and websiteb.
in my option , Domain is set for websiteb. so when user try to browser
any webpage in websiteb , cookie will be transfer to server side . The
websiteb can get login's info that user filled in login,htm

in fact . i am not sure it can works . i searched online for
solutions. there have lots of way
to solve it,but all of that depend on ablility of server side such as
redirect. since i am in apache + mod_$mycmod context in which there
was no such facility. I have to find a new way to solve my problem.

Any help is welcome

Nov 23 '05 #1
3 936
VK
> Can cookie be shared in 2 sites in this way ??

No, unless you find a really bad browser with a really broken security.
Any help is welcome

Set cookies by both Server A and Server B.
Or spuff the browser using server-side redirect.

Nov 23 '05 #2
up****@gmail.com wrote:
I just worte code in this way in my login.htm with javascript,
login.htm resides in websitea

document.cookie ='Data=' + escape(AccountStr + "|" + CheckStr +
"|" + IndexStr + "|" + AccountType + "|")
Are you aware that with this expression the delimiter character
will be escaped (to %7C) as well? You are rather looking for

escape(AccountStr) + "|" + escape(CheckStr) +
"|" + escape(IndexStr) + "|" + escape(AccountType) + "|")
+ "; expires=" + expire
s.toGMTString()+' Path=/ ;' +"Domain=www.websiteb";

my goal is to share user's loginfo between websitea and websiteb.
[...]


If all depends on the specific domains and on the domain parameter, see

<http://wp.netscape.com/newsref/std/cookie_spec.html>
Your spelling and punctuation leaves room for considerable improvement.
PointedEars
Nov 23 '05 #3
Thomas 'PointedEars' Lahn wrote:
<http://wp.netscape.com/newsref/std/cookie_spec.html>


JFTR: See e.g. <http://www.faqs.org/rfcs/rfc2965.html>
for the supposed-to-be Internet standard on this matter.
PointedEars
Nov 23 '05 #4

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

Similar topics

4
5273
by: Shannon Jacobs | last post by:
I'm doing some trivial surveys, and I want to know if the same user answers twice. Can't really know that, but at least I thought I could check for the same browser/computer combination by using a...
4
1362
by: Ian Mooney | last post by:
I'm using the HttpWebRequest and HttpWebResponse components to automatically scrape content from various internet news sites to store on my iPaq PDA which I later read off-line while commuting...
1
1195
by: Xam | last post by:
Hi Just to confirm, if I create a cookie via one of my web sites, I can't call and query that cookie from a different site can I? I want to keep checking the state between a http site and a...
1
3572
by: Earl Teigrob | last post by:
When I write inline code on a aspx page using Page.Response.Cookies() to read a cookie, everything works fine, as in the following code. Dim x As Object = Request.Cookies("thing") If x Is Nothing...
0
2143
by: Bill Borg | last post by:
Hello all, Not sure I can describe this adequately, but I am creating an endless loop when an authenticated user signs out. When the user signs out, I want to remove authentication, abandon...
7
7757
by: Doug | last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on "search.mydomain.com"; hence, a new session and cookie are being created on every sub-domain. This is occuring because...
0
1105
by: Laura K | last post by:
I am working with a shopping cart (I am suing a book). At this point I am trying to add the cartID, the productID, quantity and time. At the same time it is supposed to add a cookie. When I...
17
4146
by: Bruno | last post by:
I have a feature that is hosted on a different domain from the primary one in a frame, and need to retain values in a cookie. example: A web page at one.com contains a frame which has a page...
3
2467
by: Dan | last post by:
Hi, I am trying to refresh the cookie to make sure the timeout is reset by simply calling a blank page on my site. I am doing this because I have an external site hosted in my web that isn't...
0
7220
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
7105
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
7308
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,...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
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
3188
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...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.