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

Home Posts Topics Members FAQ

Cookie setting with IP address, not Domain name

I have an ASP.NET 2.0 site that stores a cookie on the browser. Instead of
the domain name (www.somename.com) it comes accross as the IP address of the
server. This works in Firefox, but fails with IE 6 because of security. I
went through and forced the Domain like this:

this.Response.Cookies["culture"].Value = "en-MX";
this.Response.Cookies["culture"].Expires = DateTime.Now.AddDays(30);
this.Response.Cookies["culture"].Domain = "somename.com";

This results in Firefox denying the cookie, as well as IE. Why is the
cookie coming across as an IP address? Is there a way around this?

Thanks in advance.

Todd

Oct 2 '06 #1
1 4741
the domain you specify for the cookie must belong to request domain. if the
browser is seeing an ipaddress, then you can not specify a domain. the
browser seeing the ipaddress is usualy caused by a redirect, or proxy
infront of the server.

-- bruce (sqlwork.com)
"Todd Brewer" <To********@discussions.microsoft.comwrote in message
news:46**********************************@microsof t.com...
>I have an ASP.NET 2.0 site that stores a cookie on the browser. Instead of
the domain name (www.somename.com) it comes accross as the IP address of
the
server. This works in Firefox, but fails with IE 6 because of security.
I
went through and forced the Domain like this:

this.Response.Cookies["culture"].Value = "en-MX";
this.Response.Cookies["culture"].Expires =
DateTime.Now.AddDays(30);
this.Response.Cookies["culture"].Domain = "somename.com";

This results in Firefox denying the cookie, as well as IE. Why is the
cookie coming across as an IP address? Is there a way around this?

Thanks in advance.

Todd

Oct 2 '06 #2

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

Similar topics

1
by: Rahul Chatterjee | last post by:
Hello All I have an asp page problem (the nature is slightly complex so please bear with the long winded explanation). We have a sandbox front end domain and a sandbox backend domain. The...
12
by: chrism | last post by:
Hello, I have a pop-up window that I would like to appear in front of the browser home page when a user opens IE. Problem is, I'd like it to never appear again if the user navigates back to the...
5
by: brettr | last post by:
When I reference document.cookie, there is a long string of key=value; pairs listed. I may have 100 hundred cookies on my hard drive. However, most only have one key=value pair. Does the...
4
by: socialism001 | last post by:
I'm trying to store a value in a cookie but its not working. Can anyone see what I might be doing wrong. Thanks, Chris ~~~~~~~~~~~~~~~~~~ <script language="javascript">...
3
by: Wysiwyg | last post by:
After a server created cookie is processed on the client I want it removed, cleared, or expired in the javascript block but have been unable to do this. If I set a cookie value in the server code...
1
by: CR1 | last post by:
I found a great cookie script below, but don't know how to make it also pass the values sent to the cookie, to a querystring as well for tracking purposes. Can anyone help? If there was a way to...
17
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...
6
by: kelvlam | last post by:
Hello all, I'm still a bit new with JavaScript, and I hope the guru here can shed some light for me. It's regarding handling cookie and the case-sensitive nature of JavaScript itself. My...
29
by: Jerim79 | last post by:
I did try to find the answer to this before posting, so this isn't a knee jerk reaction. What I am trying to accomplish is to have a script that opens a cookie, reads a value, and then use a...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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.