473,231 Members | 1,558 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,231 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 1815
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...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.