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

Can't Write Cookie IE

I am having trouble with my authentication cookie with IE. I create and write
the cookie here but some of the client PC never get the cookie. This does
work with other browsers like Firefox.

If Request.Cookies("portalroles") Is Nothing Then

Dim _user As New UsersDB
Dim roleStr As String = ""
Dim role As String

roleStr = _user.GetRoles(User.Identity.Name)
'For Each role In roles

'roleStr += role
'roleStr += ";"

'Next

Dim ticket As New FormsAuthenticationTicket(1, _
Context.User.Identity.Name, _
DateTime.Now, _
DateTime.Now.AddHours(1), _
False, _
roleStr)

Dim cookieStr As String = FormsAuthentication.Encrypt(ticket)
'Send Cookie to client
Response.Cookies("portalroles").Value = cookieStr
Response.Cookies("portalroles").Path = "/"
Response.Cookies("portalroles").Expires =
DateTime.Now.AddMinutes(5)

Worst part is this works on most of my clients but not on other.s
Thanks
Nov 19 '05 #1
5 1762
Are you sure the clients have their browser set to allow cookies?
Some dont.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
GarrettD78 wrote:
I am having trouble with my authentication cookie with IE. I create and write
the cookie here but some of the client PC never get the cookie. This does
work with other browsers like Firefox.

If Request.Cookies("portalroles") Is Nothing Then

Dim _user As New UsersDB
Dim roleStr As String = ""
Dim role As String

roleStr = _user.GetRoles(User.Identity.Name)
'For Each role In roles

'roleStr += role
'roleStr += ";"

'Next

Dim ticket As New FormsAuthenticationTicket(1, _
Context.User.Identity.Name, _
DateTime.Now, _
DateTime.Now.AddHours(1), _
False, _
roleStr)

Dim cookieStr As String = FormsAuthentication.Encrypt(ticket)
'Send Cookie to client
Response.Cookies("portalroles").Value = cookieStr
Response.Cookies("portalroles").Path = "/"
Response.Cookies("portalroles").Expires =
DateTime.Now.AddMinutes(5)

Worst part is this works on most of my clients but not on other.s
Thanks

Nov 19 '05 #2
Sorry I forgot to mention that. Yes we have worked and worked with the
clients including setting their privacy settings to nothing and this stil
doesn't seem to have any effect.

"Curt_C [MVP]" wrote:
Are you sure the clients have their browser set to allow cookies?
Some dont.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
GarrettD78 wrote:
I am having trouble with my authentication cookie with IE. I create and write
the cookie here but some of the client PC never get the cookie. This does
work with other browsers like Firefox.

If Request.Cookies("portalroles") Is Nothing Then

Dim _user As New UsersDB
Dim roleStr As String = ""
Dim role As String

roleStr = _user.GetRoles(User.Identity.Name)
'For Each role In roles

'roleStr += role
'roleStr += ";"

'Next

Dim ticket As New FormsAuthenticationTicket(1, _
Context.User.Identity.Name, _
DateTime.Now, _
DateTime.Now.AddHours(1), _
False, _
roleStr)

Dim cookieStr As String = FormsAuthentication.Encrypt(ticket)
'Send Cookie to client
Response.Cookies("portalroles").Value = cookieStr
Response.Cookies("portalroles").Path = "/"
Response.Cookies("portalroles").Expires =
DateTime.Now.AddMinutes(5)

Worst part is this works on most of my clients but not on other.s
Thanks

Nov 19 '05 #3
GarrettD78 wrote:
Sorry I forgot to mention that. Yes we have worked and worked with the
clients including setting their privacy settings to nothing and this stil
doesn't seem to have any effect.


Ok... guess the next thing is to find out what IS different.
If one client works and the next doesnt and they both have the same
browser start looking deeper. Most likely its not a server issue, its a
client one. Firewalls, proxy servers, etc... also, OS ver, Service
Packs, etc....

Sorry I cant be more specific in this instance but its a difficult one
to know. There are a number of options

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #4
Well thanks. I have been trying to figure out what is different but haven't
had any luck. Just seems strange because you can surf other sites and the
cookies write and can be read fine but my site it won't work.

"Curt_C [MVP]" wrote:
GarrettD78 wrote:
Sorry I forgot to mention that. Yes we have worked and worked with the
clients including setting their privacy settings to nothing and this stil
doesn't seem to have any effect.


Ok... guess the next thing is to find out what IS different.
If one client works and the next doesnt and they both have the same
browser start looking deeper. Most likely its not a server issue, its a
client one. Firewalls, proxy servers, etc... also, OS ver, Service
Packs, etc....

Sorry I cant be more specific in this instance but its a difficult one
to know. There are a number of options

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

Nov 19 '05 #5
GarrettD78 wrote:
Well thanks. I have been trying to figure out what is different but haven't
had any luck. Just seems strange because you can surf other sites and the
cookies write and can be read fine but my site it won't work.

I've had similar in the past and most of the time it ended up being the
security settings in IE actually, specifically the URL getting read as
intranet inadvertantly (or vice versa).

As a test just do a simple 2 page app with one writing and one reading
and put it out on your server and start with that as a control group, to
eliminate something with your specific site setup... just to see.
--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Nov 19 '05 #6

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

Similar topics

1
by: Mike | last post by:
Hello, I can't find any javascript that reads and writes cookies with keys, so that it is compatible with ASP (I want to read and write cookies from both javascript and ASP) for example in...
4
by: Aki | last post by:
Hi, I have a problem with writing cookies in IE. The code works fine in Netscape 7.2, Opera 8 and Firefox 1.04. In IE 6 the cookie isn't written. I run WinXP SP2. I'm trying to show a...
0
by: Serge | last post by:
Good Day Folks I'm using the following code when creating, reading, and removing a cookies. <% ' writing cookie Response.cookies("OracleLogin")("p_userid")="fcs_system"...
16
by: ben beroukhim | last post by:
I have huge number of legacy code which use standard files functions. I would like to pass a memory pointer rather than a FILE pointer. I am trying to use FILEs in the code to refer to memory...
4
by: Jason Shohet | last post by:
I'm writing a js cookie from an asp.net page. A .NET cookie won't do. Inside the js func. that writes the cookie, I do this code to see the cookie afterwards: ...
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...
2
by: Lawrence Chang | last post by:
Hi, I'm learning asp.net. I'm using my localhost IIS. I tried to write a cookie to my hard drive but I couldn't. Following is my code to write cookie in Page_Load handler. HttpCookie...
6
by: top | last post by:
when i try to write cookie on ASP page with the line like this <% Response.Cookie ("username")="test1" %> i get the message: object doesn't support this property ormethod: 'cookie' i use windows...
2
by: Kevin Blount | last post by:
I have an issue with trying to add a new name-pair to an existing cookie. Here's what I want to do: page1 - adds "loggedin=true" to cookie "Communities" adds "member_id=100" to cookie...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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.