473,402 Members | 2,061 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,402 software developers and data experts.

Cookies: Set for host rather than domain

Hi all,

I've tried all sorts of code to try and get this to work, but alas...

Setting cookies, appears to set for the domain rather than the hostname.
I've tried hardcoding, using via $_SERVER['HTTP_HOST'], prepending and
not prepending the host with a . (dot) but every time, it always sets
the cookie with the prepending dot making the cookie active for the
entire domain.

I've also tried auto-assignment of the host (ie: not setting the value
within setcookie()) and defining it myself with the same results.

The PHPSESSID cookie when set is fine, as defined within php.ini but
using setcookie() just doesn't want to play ball.

This is happening on both PHP4.3.2 and PHP4.2.2.

Anyone else come across this before and know a solution? I've googled
until I'm blue in the face and everything appears to say that the
default setting is host rather than domain, but this isn't the case for
me, neither can I see anywhere within php.ini to set the host / domain
value for the setcookie() function.

Any thoughts / ideas appreciated =)

TIA.

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/
Jul 17 '05 #1
0 1573

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

Similar topics

3
by: Katherine Hall | last post by:
I am trying to use a single cookie in two domains. One sets it (and uses it), the other uses it. I am trying to use setcookie and set the second domain name as the valid domain, but it doesn't seem...
6
by: Tom | last post by:
I know how to create a cookie using the HttpCookie. I know about setting its domain so it can be shared. So I have created a cookie on web site A and set it to expire in 10 minutes. Now I...
0
by: Pat Allan | last post by:
I've spent half a day on this with no success, so I'm hoping someone can point out what I'm doing wrong. I have an ASP.NET Server-side component that I've created, and as part of its Render...
10
by: Stephan Schulz | last post by:
Hi all, I'm fairly new to JavaScript, and couldn't find a way to solve the following problem: I've written an application in DHTML/JavaScript, for one because I want to be able to offer...
4
by: Brano | last post by:
HI all, I have this problem I have two pages on one I use this code to set some cookies: Response.Cookies("cokFirstName").Expires = DateTime.MaxValue Response.Cookies("cokFirstName").Value =...
12
by: Don Juan | last post by:
I have a simple html document I have been using for some time on my (i.e.) abc.com domain that uses cookies. I recently purchased a new domain name and set up a service to redirect my new domain...
3
by: Ben Holness | last post by:
Hi all, I have a php/mysql website where people can upload their own graphics for the buttons and background of pages on the website. This used to run on one server, but I have now been asked...
3
by: Matthew Laping | last post by:
I'm in the process of creating a web farm, however my cookie information is not seen by both servers. I'm thinking it might be a security issue because my web farm is not fully functional....
3
by: Inny | last post by:
I want To offer a login Option, two Checkboxs, 1 labeled 'normal' the other labeled 'Forever'. I want to assign the check boxes to switch between the cookie script below (normal) and An altered...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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,...

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.