473,408 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Accessing cookies after domain has been mapped to another domain/folder

Don
I had my host map "domainA.com" to folder "domainB.com/folder". I'm finding when accessing
"domainA.com" that PHP scripts which utilize $_COOKIE[] aren't able to see the cookies belonging to
"domainA.com". However, JavaScript scripts can see the cookies via "document.cookie". So far, the
only way I've found to deal with this is to redirect all access to "domainA.com/index.html" to
"domainB.com/remappedindex.html". Any ideas on a better, more straight forward way to do deal with
this?

Thanks,
Don

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #1
4 1820
Don wrote:
I had my host map "domainA.com" to folder "domainB.com/folder". I'm
finding when accessing "domainA.com" that PHP scripts which utilize
$_COOKIE[] aren't able to see the cookies belonging to "domainA.com".
However, JavaScript scripts can see the cookies via
"document.cookie". So far, the only way I've found to deal with this
is to redirect all access to "domainA.com/index.html" to
"domainB.com/remappedindex.html". Any ideas on a better, more
straight forward way to do deal with this?


When you are setting the cookie through the setCookie() function, use the
"/" as the fourth "path" argument.

When setting the cookie through a header call, be sure to append the
"path=/" string.
JW

Jul 17 '05 #2
Don
On Sun, 27 Feb 2005 12:37:55 +0100, "Janwillem Borleffs" <jw@jwscripts.com> wrote:
Don wrote:
I had my host map "domainA.com" to folder "domainB.com/folder". I'm
finding when accessing "domainA.com" that PHP scripts which utilize
$_COOKIE[] aren't able to see the cookies belonging to "domainA.com".
However, JavaScript scripts can see the cookies via
"document.cookie". So far, the only way I've found to deal with this
is to redirect all access to "domainA.com/index.html" to
"domainB.com/remappedindex.html". Any ideas on a better, more
straight forward way to do deal with this?


When you are setting the cookie through the setCookie() function, use the
"/" as the fourth "path" argument.

When setting the cookie through a header call, be sure to append the
"path=/" string.
JW

I believe I'm doing that. Here's the statement I'm using. Any other ideas?

document.cookie = "cpceCtrlPanelFuncsCookie=" + cpceCtrlPanelFuncsCookieStrPartial + "; expires=Wed,
01-Jan-2014 00:00:01 GMT; path=/";

Thanks,
Don

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #3
Don wrote:
document.cookie = "cpceCtrlPanelFuncsCookie=" +
cpceCtrlPanelFuncsCookieStrPartial + "; expires=Wed, 01-Jan-2014
00:00:01 GMT; path=/";


This is a javascript cookie which, especially in IE, is assigned merely as a
property of the document object when stuff goes wrong (you can check if the
cookie was set successfully by alerting the cookie and verifying that only
the cookie name and value are shown).

Try to set the cookie with PHP instead and see what happens.
JW

Jul 17 '05 #4
Don
On Sun, 27 Feb 2005 16:10:53 +0100, "Janwillem Borleffs" <jw@jwscripts.com> wrote:
Don wrote:
document.cookie = "cpceCtrlPanelFuncsCookie=" +
cpceCtrlPanelFuncsCookieStrPartial + "; expires=Wed, 01-Jan-2014
00:00:01 GMT; path=/";


This is a javascript cookie which, especially in IE, is assigned merely as a
property of the document object when stuff goes wrong (you can check if the
cookie was set successfully by alerting the cookie and verifying that only
the cookie name and value are shown).

Try to set the cookie with PHP instead and see what happens.
JW

Thanks for the suggestion JW. But, given the nature of what I'm doing in the page, I have to set it
via JS. I have a feeling there's no way around remapping the domain.

Thanks for your help.
Don

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #5

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

Similar topics

3
by: Raterus | last post by:
Hello, I've got a bunch of web-portals that customers use to log-in and see their data. In a production environment, each of these has a completely different domain name, but they all point back...
1
by: Dennis Allen | last post by:
Hi. Got a client with three web sites. I want to be able to pass cookies between these sites, so far no luck. Tried: document.cookie = name + "=" + escape (value) + ((exp == null) ? "" : (";...
12
by: Mike | last post by:
Hello, I have been trying to get cookies to work. It seems I can get this cookie to be persistant in the browser but I want to write it to my Cookies Folder. I have tried many variations but when...
1
by: Z0gS | last post by:
I got this problem for the web application I try to access files on a remote server. string dirs = Directory.GetDirectories(@"E:\vehicles") E drive is a map to a network drive. I get the...
3
by: Aah | last post by:
here is my code which is use to create a cookie for some reason when I use the domain property I am not able to see the cookie in my cookies folder. But when I comment out my domain property, I...
2
by: Ian Murrell | last post by:
My application writes a text data file to a folder on another computer. The other computer is mapped by drive letter to the root (C) shared folder, eg as G:. The network is simple peer2peer, shared...
3
by: dotnettester | last post by:
Hi, I'm trying to read a network drive through ASP.net. This is what I have done. - Create folder on a network machine. - gave ASPNET_User read permssion on the folder. - Mapped a drive to the...
8
by: Ben Fidge | last post by:
Hi I have a small WinForms app that needs to copy files from a shared drive on a network. If I connect to the mapped drive using Explorer, a password dialog pops-up and I have to provide...
2
by: Gerhard | last post by:
I have a .net application that I want to run in a DMZ, with the SQL Server and file system behind another firewall. Is there a secure way to get to files from my application, or would it be better...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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
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
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
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...

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.