473,581 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(ByVa l cUserAlias, ByVal nUserID)
Response.Cookie s("userInfo")(" userAlis") = cUserAlias
Response.Cookie s("userInfo")(" userID") = nUserID
Response.Cookie s("userInfo").E xpires = DateTime.Now.Ad dDays(1)
End Sub

If Not Request.Cookies ("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userAlias" ))
nUserId =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userID"))
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 2799
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.in valid> wrote in message
news:3i******** *************** *********@4ax.c om...
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(ByVa l cUserAlias, ByVal nUserID)
Response.Cookie s("userInfo")(" userAlis") = cUserAlias
Response.Cookie s("userInfo")(" userID") = nUserID
Response.Cookie s("userInfo").E xpires = DateTime.Now.Ad dDays(1)
End Sub

If Not Request.Cookies ("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userAlias" ))
nUserId =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userID"))
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.in valid> wrote in message
news:3i******** *************** *********@4ax.c om...
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(ByVa l cUserAlias, ByVal nUserID)
Response.Cookie s("userInfo")(" userAlis") = cUserAlias
Response.Cookie s("userInfo")(" userID") = nUserID
Response.Cookie s("userInfo").E xpires = DateTime.Now.Ad dDays(1)
End Sub

If Not Request.Cookies ("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userAlias" ))
nUserId =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userID"))
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*********@ex ample.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.in valid> 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(ByVa l cUserAlias, ByVal nUserID)
Response.Cookie s("userInfo")(" userAlis") = cUserAlias
Response.Cookie s("userInfo")(" userID") = nUserID
Response.Cookie s("userInfo").E xpires = DateTime.Now.Ad dDays(1)
End Sub

If Not Request.Cookies ("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userAlias" ))
nUserId =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userID"))
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*********@ex ample.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.in valid> 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(ByVa l cUserAlias, ByVal nUserID)
Response.Cookie s("userInfo")(" userAlis") = cUserAlias
Response.Cookie s("userInfo")(" userID") = nUserID
Response.Cookie s("userInfo").E xpires = DateTime.Now.Ad dDays(1)
End Sub

If Not Request.Cookies ("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userAlias" ))
nUserId =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userID"))
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.in valid> wrote in message
news:f7******** *************** *********@4ax.c om...

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*********@ex ample.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.in valid> 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(ByVa l cUserAlias, ByVal nUserID)
Response.Cookie s("userInfo")(" userAlis") = cUserAlias
Response.Cookie s("userInfo")(" userID") = nUserID
Response.Cookie s("userInfo").E xpires = DateTime.Now.Ad dDays(1)
End Sub

If Not Request.Cookies ("userInfo") Is Nothing Then
cUserAlias =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userAlias" ))
nUserId =
Server.HtmlEnco de(Request.Cook ies("UserInfo") ("userID"))
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
1840
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 users to turn-off this Pop-up after they've reviewed the changes. Currently, I'm debating whether to use cookies or build a table that will set...
4
1897
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 I go to the IE (6.0) Tools | Internet Options | Privacy Tab and select "Block All Cookies" level the following still returns true in my Page_Load...
4
1893
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. Can anybody help me out with this? private void Page_Load(object sender, System.EventArgs e) { if (!(Page.IsPostBack))
9
3053
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 application, how can we code the project to check to make sure the browser accepts cookies? 2. Where would we put this code? In Global.asax? 3. ...
5
5272
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 post back, when I try to retreive it from Request.Cookies collection, it appears that it does not exists. This problem does not occur on several...
2
1120
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 have been looking our asses off but can not find a working solution. the code we came up with is ...
1
1175
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 environment is works. Why? Is there a way to make this work in the intranet environment? Thanks in advance Guru
3
1789
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 cookies: Unchecked The server runs a Classic ASP application running in IIS 5.x that uses the session cache. These are different machines...
3
1543
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 a session variable like this: Session = "Hello"; On the first page there is a button that navigates to the second page, like this:...
0
7789
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8301
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7894
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8169
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6551
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3803
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3820
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2300
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 we have to send another system
0
1132
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.