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

Cookie parsing problem

Hi everyone,

We developped a WebService with Visual Studio .Net and we faced an
authentication problem with a java client. My assumption is that this
is because cookies passed from client are misunderstood by the
framework.

Basically, these are the headers received from the client (I used a
packet sniffer to know exactly what we received from him before the
framework modifies it):
==========================*======================= =======*=
POST /webservices/csaccessservices.*asmx HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml,...(trunc*ated for clarity)
User-Agent: Axis/1.2.1
Cache-control: no-cache
Pragma: no-cache
SOAPAction: "http://cedrom-sni.com/schema/WhoAmI"
Content-Length: 308
Authorization: Basic Y253ZG5hMTNFXzE6Y253ZG5FMQ==
Cookie: ASP.NET_SessionId=xsigyd55n0nf*4q55kujvolzi
Cookie: IDENTITY=C2AC936CD45DE...(trun*cated for clarity)
==============================*=================== ========

and this is what I have when I look at the headers and server variables

when entering Application_BeginRequest method:
==============================*=================== ========
POST /webservices/csaccessservices.*asmx HTTP/1.0
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 308
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml,...(trunc*ated for clarity)
Authorization: Basic Y253ZG5hMTNFXzE6Y253ZG5FMQ==
Cookie: ASP.NET_SessionId=xsigyd55n0nf*4q55kujvolzi, IDENTITY=C2A...
User-Agent: Axis/1.2.1
SOAPAction: "http://cedrom-sni.com/schema/WhoAmI"
==============================*=================== ========

As you can see, cookies have been merged on a single line. If it
worked, I wouldn't care about it, but it isn't. When I look at
Context.Request.Cookies object provided by the framework, I see that
there is only one cookie! It's name is ASP.NET_SessionId (the first
cookie) and it's value is the IDENTITY-value (C2A...)!!! So it seems
like the framework doesn't parse correctly the cookies, but I don't
know why??? It doesn't see the second cookie but it takes the second
cookie's value and associate this value with the first cookie. This is
kind of weird!!!

When I ask for the value of
Context.Request.ServerVariable*s["HTTP_COOKIE"], the entire line is
returned.

I was able to reproduce this strange behavior by calling our webservice

using System.Net.WebRequest with a POST method. The cookies were on a
single line and separated by "," and they cookies were parsed by the
framework exactly the same way they are when called from java.

I know that if I call this webservice from a .Net client with
WebReferences it works well, but there is a slight difference between
the calls: cookies are separated by ";" instead of ",".

Any hint or help would be appreciated.

Thanks

Karl

Nov 23 '05 #1
0 2358

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

Similar topics

2
by: bagsmode | last post by:
Hi, I'm trying to set a session cookie and then redirect, however I get the error: Status: 302 Moved Location: /index.cgi I thought I recall getting an error like this when I first tried...
4
by: Derick Bailey | last post by:
I have a development website running on Win2K Server, using ASP 3.0. I'm using IE6 (all updates added). I have a cookie that is set on a login page, which is an Encrypted password:...
0
by: Karl | last post by:
Hi everyone, We developped a WebService with Visual Studio .Net and we faced an authentication problem with a java client. My assumption is that this is because cookies passed from client are...
5
by: | last post by:
Hi, I'm trying to use the cookie munging session handling behaviour of asp.net instead of cookies themselves as I'm finding quite a few people are barring cookies (especially AOL users). If I...
1
by: Ken Varn | last post by:
I have a page that uses two cookies. On postback, both cookies are updated and added back into the Page.Response.Cookies collection. For some reason, only the first cookie is actually updated...
1
by: Charlie | last post by:
Hi: Our portal writes a cookie to browser on login. The cookie is then requested by applications launched by portal as a way of passing credentials. The problem is when logging off portal,...
0
by: Jimmy | last post by:
Problem: My cookie name is supposed to be "MyCookie123whatever..." but when I take a look at my cookies, it's called "SITESERVER" and it's not keeping any of the properties (expiration, etc..)...
1
by: 4site | last post by:
Hi all, this is probably stupidly easy but I'm struggling. I am trying to understand why cookies only appear to be readable when a web page is retrieved by *typing the url into the browser's...
10
by: eyal.herlin | last post by:
hi, i set a cookie to hold a utf-8 string. either by the server or by the client. it doesn't matter. when i try to read this cookie using Request.Cookies("my_utf8_cookie") on iis 5.0 i get...
5
by: Mike C# | last post by:
Is there a decent cookie parser out there somewhere? I keep running into cookies that .NET can't handle. I've also found a couple of other parsers but they're choking as well.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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,...

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.