473,395 Members | 1,442 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,395 software developers and data experts.

Cookies and webhop.

Hi,
Apologies of you have heard this many times before, but I don't know if
this is a .NET problem or javascript, or something else.

I am using IE6 to view pages from a corporate web server through
internet, not VPN. But, the I use a webhop service, so the URL I use is
silently redirected to another place. I think this is because the
company uses dynamic IP addresses for the server.

Anyway, I am trying to use a cookie to remember user login info, but
the cookie is not working. If connect to the server through the VPN
(when I know the IP address of the server) everything works fine. So, I
am thinking that the webhop thing is causing me a problem with cookie.

Reading about the cookie I think that either the path or the domain
needs setting.
Am I on the right lines here, or is it something else?

Any help appreciated.

Regards

Nov 4 '06 #1
7 2595
VK
I am using IE6 to view pages from a corporate web server through
internet, not VPN. But, the I use a webhop service, so the URL I use is
silently redirected to another place.
Cookies are attached to a particular protocol (http / https) and domain
name. They don't care about IP's. So if you have say
http://webhop.net/foo/bar.html in your address bar then you have to set
cookie for http://webhop.net.
It is irrelevant that this page is really
http://www.corpserver.com/foo.html

Nov 5 '06 #2
VK wrote:

[snip]
Cookies are attached to a particular protocol (http / https) and domain
name. They don't care about IP's. So if you have say
http://webhop.net/foo/bar.html in your address bar then you have to set
cookie for http://webhop.net.
It is irrelevant that this page is really
http://www.corpserver.com/foo.html
Logic would dictate otherwise.

If a cookie is set for the domain webhop.net, then the cookie will only
be sent whilst making a request to host names with that domain suffix.
If the user agent is redirected to www.corpserver.com, it will /not/
send the cookie data for this second request as it is not the same
domain used when setting it.

Mike
Nov 5 '06 #3
VK
Michael Winter wrote:
If a cookie is set for the domain webhop.net, then the cookie will only
be sent whilst making a request to host names with that domain suffix.
If the user agent is redirected to www.corpserver.com, it will /not/
send the cookie data for this second request as it is not the same
domain used when setting it.
This is why I said "in your address bar" about the addess. WebHop is
not just a redirect service, it is a DNS redirection service ("server
negotiator" on the recent lingo). It means that user types in
http://www.webhop.net/foo/bar.html and she gets
http://www.webhop.net/foo/bar.html and she has
http://www.webhop.net/foo/bar.html in her browser address bar. The
browser has no means to know (nor does it care) that it is actually
http://www.someallanotherserver.info/index.html
Respectively all cookies has to be set for http://www.webhop.net or
this bird won't fly. As an option one can set a pair of cookies: for
http://www.webhop.net and for http://www.someallanotherserver.info - to
cover all holes.

Overall using DNS redirection services for a *business* solutions is a
very strange approach, especially with VPN involved.

Nov 5 '06 #4
VK wrote:
>
Overall using DNS redirection services for a *business* solutions is a
very strange approach, especially with VPN involved.
The VPN is only used by me to get my code to the server. The idea is to
have a corporate web server allowing users to use a company resource
either internally or through the internet. The business in question
doesn't want to waste money on a static IP address when a dynamic one
and the webhop facility is cheaper.

Anyway, I have been investigating the use of the path and domain
properties of the cookie. If I set the domain to anything (even
localhost) the cookies stop working altogether, even when testing on my
laptop.
The only time that cookies work are when I don't set anything in the
domain property, and I run the webserver either locally or I access
webpages on the remote server through VPN. If I try to do it through
the webhop the cookies don't work.

Regards

Nov 6 '06 #5

Well, I made some progress.
If I add the URL to the list of trusted sites in Tools|Internet Options
| Privacy (tab) | Sites then I can sort of get the cookies to be
remembered.
The cookie works while I am navigating pages on the site.
However, if I close IE and start a new session then the cookie is not
there!

Regards

Nov 6 '06 #6
VK

Control Freq wrote:
Well, I made some progress.
If I add the URL to the list of trusted sites in Tools|Internet Options
| Privacy (tab) | Sites then I can sort of get the cookies to be
remembered.
The cookie works while I am navigating pages on the site.
However, if I close IE and start a new session then the cookie is not
there!
Do you have proper rules set in your P3P file on the server? (If your
answer would be "and what is P3P?" then we've most probably jumped
right on the problem ;-).

In relevance to JavaScript the cookie handling is as simple as
reading/setting document.cookie property and I don't see how it would
affect the issue (though it *may*). Otherwise a more relevant newsgroup
would be <comp.infosystems.www.servers.miscor something else more
HTTP data exchange specific. We may try to end it up here but in this
case an abstract problem description doesn't make the trick any more.
It has to be an URL (not a code sample, but an active URL)
demonstrating the actual problem.

Nov 6 '06 #7

VK wrote:
Control Freq wrote:
Well, I made some progress.
If I add the URL to the list of trusted sites in Tools|Internet Options
| Privacy (tab) | Sites then I can sort of get the cookies to be
remembered.
The cookie works while I am navigating pages on the site.
However, if I close IE and start a new session then the cookie is not
there!

Do you have proper rules set in your P3P file on the server? (If your
answer would be "and what is P3P?" then we've most probably jumped
right on the problem ;-).
Well, a compact privacy policy would help but it depends on the
security settings in IE. The default setting would block cookies, but I
have temporarily got around that by adding the URL to the list of
trusted sites.
However, in doing this I noticed that the URL I was using was
incorrect. This is due to the webhop DNS redirection I mentioned in the
OP. So, by using the hidden URL in the domain setting of the cookie I
can now get it all to work. I have also added a compact policy to the
headers so that I don't need to add the URL in the trusted sites list.

Unfortunately, this means that someone can view the page source and see
the underlying URL. I don't know if this is a security risk or not.

Thanks for the suggestions, and help. But, as I suspected, the problem
lay in the domain setting of the cookie all along, I just needed the
correct domain!
>
In relevance to JavaScript the cookie handling is as simple as
reading/setting document.cookie property and I don't see how it would
affect the issue (though it *may*). Otherwise a more relevant newsgroup
would be <comp.infosystems.www.servers.miscor something else more
HTTP data exchange specific. We may try to end it up here but in this
case an abstract problem description doesn't make the trick any more.
It has to be an URL (not a code sample, but an active URL)
demonstrating the actual problem.
Nov 7 '06 #8

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

Similar topics

4
by: Brian Burgess | last post by:
Hi all, Anyone know of any special issues with storing cookies with ASP? I'm trying this with two browsers: One is IE 6.0 with cookies set to 'prompt'. This has been working properly as any...
20
by: Brian Burgess | last post by:
Hi all, Anyone know if this is possible? If so, on which page would the cookie be? .. On the page calling a function defined in the include file? thanks in advance.. -BB
9
by: | last post by:
Is it possible for a user to enable permanent cookies but disable session cookies.....this seems like a contradition yet this is what I appear to be reading in online articles?
1
by: John Taylor-Johnston | last post by:
I'm a University academic looking for a proper definition of JavaScript Cookies. http://www.CollegeSherbrooke.qc.ca/languesmodernes/604-HAE_Grammar_Practice/ I'm trying to decipher what...
6
by: Mark | last post by:
Hi... I've come across some weird bug with Response.Cookies. Or maybe it will be called "by design" but for the life of me I can't figure out what purpose it would serve. If you're setting a...
8
by: CDARS | last post by:
Hi all, I have a confusing question on ASP.NET cookies usage: 1> Response.Cookies("test").value = Now 2> Response.Write(Request.Cookies("test").value) 3> 4> Response.write("<hr>") 5>...
6
by: Stephane | last post by:
Hi, I have a login page where if the user wants his access codes to be saved are set into a cookie. In the logout page, I want to delete those cookies. I tried this and this is not working at...
1
by: Alex Nitulescu | last post by:
I have the following very simple colde (while learning about cookies and session state): Private Sub cmdAddCookie_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles...
0
by: rn5a | last post by:
This is how I am creating & then reading cookies: <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) 'create cookies Response.Cookies("UserName").Value = "Ron"...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...
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...

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.