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

Cookies working on intranet but NOT working on Internet

Hi

We are working on a webservice application and are having some
problems with the cookies and/or sessions.

We have them working on our intranet but then its not working on the
internet. We have been looking our asses off but can not find a
working solution.

the code we came up with is ...

Public Sub SetCookies(ByVal cUserAlias, ByVal nUserID)
Response.Cookies("userInfo")("userAlis") = cUserAlias
Response.Cookies("userInfo")("userID") = nUserID
Response.Cookies("userInfo").Expires = DateTime.Now.AddDays(1)
End Sub

If Not Request.Cookies("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rAlias"))
nUserId =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rID"))
End If

What are we doin wrong. Why is there no cookie created when we logon
to our project over the internet and IS there a cookie created when we
logon over our intranet. Any help is appreciated

Martin

Nov 19 '05 #1
5 2778
Hi,
I would guess (not knowing how you are setup) this has something to do with
how your intranet and internet sites have different domains and this is
affecting how IE is dealing with cookie security.
You may need to implement P3P privacy policy on the servers in order for
cookies to work (its easy). This is not really a .NET problem but more of a
"dang, why did they put that feature in IE6" problem. Please refer to this
short article:
http://www.microsoft.com/windowsxp/u...nmore/ie6.mspx

For example, your intranet site might be acting as a third-party site to
your first-party internet site, and by default IE6 blocks third-party
cookies. You can try testing this by setting IE6 cookie security to "accept
all cookies" and see what happens.

Another alternative to the P3P thing is if you have control over all users
browsers, you could change their Privacy settings in their browsers, to
override the IE6 defaults.

HTH,
Premier JiangZemin

"Martin Heuckeroth" <ni**@nospam.invalid> wrote in message
news:3i********************************@4ax.com...
Hi

We are working on a webservice application and are having some
problems with the cookies and/or sessions.

We have them working on our intranet but then its not working on the
internet. We have been looking our asses off but can not find a
working solution.

the code we came up with is ...

Public Sub SetCookies(ByVal cUserAlias, ByVal nUserID)
Response.Cookies("userInfo")("userAlis") = cUserAlias
Response.Cookies("userInfo")("userID") = nUserID
Response.Cookies("userInfo").Expires = DateTime.Now.AddDays(1)
End Sub

If Not Request.Cookies("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rAlias"))
nUserId =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rID"))
End If

What are we doin wrong. Why is there no cookie created when we logon
to our project over the internet and IS there a cookie created when we
logon over our intranet. Any help is appreciated

Martin

Nov 19 '05 #2
PS.
I assume the difference in spelling "userAlis" vs. "userAlias" in your code
is just a copy-and-paste bug, and not in your actual code?
-Premier JiangZemin

"Martin Heuckeroth" <ni**@nospam.invalid> wrote in message
news:3i********************************@4ax.com...
Hi

We are working on a webservice application and are having some
problems with the cookies and/or sessions.

We have them working on our intranet but then its not working on the
internet. We have been looking our asses off but can not find a
working solution.

the code we came up with is ...

Public Sub SetCookies(ByVal cUserAlias, ByVal nUserID)
Response.Cookies("userInfo")("userAlis") = cUserAlias
Response.Cookies("userInfo")("userID") = nUserID
Response.Cookies("userInfo").Expires = DateTime.Now.AddDays(1)
End Sub

If Not Request.Cookies("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rAlias"))
nUserId =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rID"))
End If

What are we doin wrong. Why is there no cookie created when we logon
to our project over the internet and IS there a cookie created when we
logon over our intranet. Any help is appreciated

Martin

Nov 19 '05 #3

Thx for your concern. Indeed, it's a typo :D
On Thu, 24 Mar 2005 20:25:12 -0500, "JiangZemin"
<fo*********@example.com> wrote:
PS.
I assume the difference in spelling "userAlis" vs. "userAlias" in your code
is just a copy-and-paste bug, and not in your actual code?
-Premier JiangZemin

"Martin Heuckeroth" <ni**@nospam.invalid> wrote in message
news:3i********************************@4ax.com.. .
Hi

We are working on a webservice application and are having some
problems with the cookies and/or sessions.

We have them working on our intranet but then its not working on the
internet. We have been looking our asses off but can not find a
working solution.

the code we came up with is ...

Public Sub SetCookies(ByVal cUserAlias, ByVal nUserID)
Response.Cookies("userInfo")("userAlis") = cUserAlias
Response.Cookies("userInfo")("userID") = nUserID
Response.Cookies("userInfo").Expires = DateTime.Now.AddDays(1)
End Sub

If Not Request.Cookies("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rAlias"))
nUserId =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rID"))
End If

What are we doin wrong. Why is there no cookie created when we logon
to our project over the internet and IS there a cookie created when we
logon over our intranet. Any help is appreciated

Martin


Nov 19 '05 #4

Hi,

Thanks for your answer. You spotted the problem. Indeed, its all
working when i working when i adjust the privacy settings in my
browser from medium to accept all cookies.

Can you deliver any insight on setting the priviacy policy on the
website to have the browser accept the cookies? Or steer me in the
right direction?

Tia, Martinh
On Thu, 24 Mar 2005 20:21:55 -0500, "JiangZemin"
<fo*********@example.com> wrote:
Hi,
I would guess (not knowing how you are setup) this has something to do with
how your intranet and internet sites have different domains and this is
affecting how IE is dealing with cookie security.
You may need to implement P3P privacy policy on the servers in order for
cookies to work (its easy). This is not really a .NET problem but more of a
"dang, why did they put that feature in IE6" problem. Please refer to this
short article:
http://www.microsoft.com/windowsxp/u...nmore/ie6.mspx

For example, your intranet site might be acting as a third-party site to
your first-party internet site, and by default IE6 blocks third-party
cookies. You can try testing this by setting IE6 cookie security to "accept
all cookies" and see what happens.

Another alternative to the P3P thing is if you have control over all users
browsers, you could change their Privacy settings in their browsers, to
override the IE6 defaults.

HTH,
Premier JiangZemin

"Martin Heuckeroth" <ni**@nospam.invalid> wrote in message
news:3i********************************@4ax.com.. .
Hi

We are working on a webservice application and are having some
problems with the cookies and/or sessions.

We have them working on our intranet but then its not working on the
internet. We have been looking our asses off but can not find a
working solution.

the code we came up with is ...

Public Sub SetCookies(ByVal cUserAlias, ByVal nUserID)
Response.Cookies("userInfo")("userAlis") = cUserAlias
Response.Cookies("userInfo")("userID") = nUserID
Response.Cookies("userInfo").Expires = DateTime.Now.AddDays(1)
End Sub

If Not Request.Cookies("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rAlias"))
nUserId =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rID"))
End If

What are we doin wrong. Why is there no cookie created when we logon
to our project over the internet and IS there a cookie created when we
logon over our intranet. Any help is appreciated

Martin


Nov 19 '05 #5
Hi,
these links should help:
http://msdn.microsoft.com/library/de...vacypolicy.asp

http://support.microsoft.com/?kbid=324013

The easiest thing to do is to just add compact policies to HTTP headers,
thru IIS. This can be done very quickly, esp. if you just use some sample
policies which is kind of cheating, but this might not be the "right" thing
to do, depending on the likelihood of your site getting sued by a user who
somehow discovers that your compact policy doesnt actually reflect your
company's privacy policy, and gets upset enough to call a lawyer.
Actually i think the chances of that happening for most sites are almost
zero, and ive never heard of any cases where P3P is anything more than an
annoying "feature" that trips up a lot of people. So i would guess the
majority of web programmers just take the easy way out and add this dummy
header which -should- be enough to fool IE into thinking that a compact
policy exists:
CP="TST". If you use that dummy header make sure to test it with latest
version of IE6, with "medium" setting.

On the other end of the scale you could get your company's legal dept
involved in crafting the privacy policy for your site, and work with them to
translate it according to the P3P spec. But that could take a while. :^P

HTH,
Premier JiangZemin

"MartinH" <ni**@nospam.invalid> wrote in message
news:f7********************************@4ax.com...

Hi,

Thanks for your answer. You spotted the problem. Indeed, its all
working when i working when i adjust the privacy settings in my
browser from medium to accept all cookies.

Can you deliver any insight on setting the priviacy policy on the
website to have the browser accept the cookies? Or steer me in the
right direction?

Tia, Martinh
On Thu, 24 Mar 2005 20:21:55 -0500, "JiangZemin"
<fo*********@example.com> wrote:
Hi,
I would guess (not knowing how you are setup) this has something to do
with
how your intranet and internet sites have different domains and this is
affecting how IE is dealing with cookie security.
You may need to implement P3P privacy policy on the servers in order for
cookies to work (its easy). This is not really a .NET problem but more of
a
"dang, why did they put that feature in IE6" problem. Please refer to
this
short article:
http://www.microsoft.com/windowsxp/u...nmore/ie6.mspx

For example, your intranet site might be acting as a third-party site to
your first-party internet site, and by default IE6 blocks third-party
cookies. You can try testing this by setting IE6 cookie security to
"accept
all cookies" and see what happens.

Another alternative to the P3P thing is if you have control over all users
browsers, you could change their Privacy settings in their browsers, to
override the IE6 defaults.

HTH,
Premier JiangZemin

"Martin Heuckeroth" <ni**@nospam.invalid> wrote in message
news:3i********************************@4ax.com. ..
Hi

We are working on a webservice application and are having some
problems with the cookies and/or sessions.

We have them working on our intranet but then its not working on the
internet. We have been looking our asses off but can not find a
working solution.

the code we came up with is ...

Public Sub SetCookies(ByVal cUserAlias, ByVal nUserID)
Response.Cookies("userInfo")("userAlis") = cUserAlias
Response.Cookies("userInfo")("userID") = nUserID
Response.Cookies("userInfo").Expires = DateTime.Now.AddDays(1)
End Sub

If Not Request.Cookies("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rAlias"))
nUserId =
Server.HtmlEncode(Request.Cookies("UserInfo")("use rID"))
End If

What are we doin wrong. Why is there no cookie created when we logon
to our project over the internet and IS there a cookie created when we
logon over our intranet. Any help is appreciated

Martin

Nov 19 '05 #6

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

Similar topics

5
by: Scott | last post by:
On an Intranet Web application I'm working on, I need to display a Pop-up that shows the users what report changes have occurred. This may happen once a week or more and I need a way for the...
4
by: Greg Livengood | last post by:
I need to test my ASP.net web application for the case that the client browser doesn't support cookies or for the case that cookies are turned off on the client browswer. What is odd is that when...
4
by: mike parr | last post by:
I'm trying to do a check to see if the client browser has cookies enabled. But my code below always gives me the value for acceptsCookies = true, whether the machine has cookies enabled or not. ...
9
by: SHarris | last post by:
Hello, In our new intranet ASP.NET project, two requirements are that the browser accept cookies AND JavaScript. We are requiring the use of Internet Explorer 6+. 1. Using C# in an ASP.NET...
5
by: Miljana | last post by:
Hi, I have one problem with cookies in ASP.NET application. It seems that I can not retreive cookie from Request.Cookies collection. I put cookie in Response.Cookies collection, and after page...
2
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
1
by: Guru | last post by:
I am creating a cookie when a person logs in which will keep track of the country the user is from. When I test it in the intranet environment a cookie is not created at all. But in an internet...
3
by: Griff | last post by:
UserA has a PC running IE 6. This has the cookies disabled: 1 - Override automatic cookie handling: checked 2 - First party cookies: Block 3 - Third-party cookies: Block 4 - Always allow session...
3
by: Chris Zopers | last post by:
Hello, I've read somewhere that sessionstate does not work when a browser has disabled cookies, so I wanted to test this and did the following: I added two aspx pages (c#), in the first I set...
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: 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:
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 =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.