You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Haitham Mahmoud <ha...@advantechnologies.com> on 2002/07/25 01:58:40 UTC
Cookie Passing Problem
Hi All,
I have been getting this problem only with Apache Servers (I tried it
with versions 1.3.12 and version 2.0.36)
Part of the application I am involved in implements cookie
authentcation, calling the verification page with the login information
and then propagating the saved cookie information with each request, I
am using raw sockets to perform the operation (in java), It always
giving me the same error with Apache, calling the authentication page
works fine, however, when I try to pass the Cookie header field set to
the saved cookie value, the socket keeps waiting for the response that
never come.
The same mechanism I used it with IIS server and it works with no problems,
here is my login request header
----------------
POST /admin/ProcessLogin.jsp HTTP/1.1
Host: host
Connection: CLOSE
Accept: text/html
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Referer: http://host:8080/admin/index.html
Content-Type: application/x-www-form-urlencoded
Cache-control: private
Content-Length: 44
user_id=administrator&password=administrator
----------------
Response header :
----------------
HTTP/1.1 302 Moved Temporarily
Date: Wed, 24 Jul 2002 23:49:38 GMT
Server: Apache/2.0.36 (Win32) mod_jk/1.2.0
Set-Cookie: JSESSIONID=893DE7C2176B3B10536D08D600FA419A;Path=/admin
Location: http://host:8080/admin/AdminHome.jsp
Content-Length: 0
Connection: close
Content-Type: text/html;charset=ISO-8859-1
----------------
I then submit the my request for the other page:
----------------
GET /admin/ListPages.jsp HTTP/1.1
Host: host
Accept: text/html
Cookie: JSESSIONID=893DE7C2176B3B10536D08D600FA419A;Path=/admin
User-agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Content-Type: text/html
----------------
The socket keeps waiting and no response shows, I dont know where the
problem is and I really appreicate it if you can help me with that
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Cookie Passing Problem
Posted by Haitham Mahmoud <ha...@advantechnologies.com>.
Hi All,
That was the cause of the problem, when I pass the path value
"Path=/admin" in Cookie header parameter, with Apache version 2.036, the
socket keeps waiting forever, with version 1.3.12 the story is a bit
different and it returns this error:
<h1>Error: 500</h1>
<h2>Location: /ui/menuNews/user.jsp</h2><b>Internal Servlet Error:</b><br>
<pre>
java.lang.IllegalArgumentException: Cookie name Path is a reserved token
at javax.servlet.http.Cookie.<init>(Cookie.java:185)
at
org.apache.tomcat.util.RequestUtil.processCookies(RequestUtil.java:187)
at
org.apache.tomcat.core.RequestImpl.getCookies(RequestImpl.java:379)
at
org.apache.tomcat.request.SessionInterceptor.requestMap(SessionInterceptor.java:101)
at
org.apache.tomcat.core.ContextManager.processRequest(ContextManager.java:594)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:552)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156)
at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
at java.lang.Thread.run(Thread.java:536)
</pre>
Thanks
Haitham Mahmoud wrote:
> Hi All,
> I have been getting this problem only with Apache Servers (I tried it
> with versions 1.3.12 and version 2.0.36)
> Part of the application I am involved in implements cookie
> authentcation, calling the verification page with the login
> information and then propagating the saved cookie information with
> each request, I am using raw sockets to perform the operation (in
> java), It always giving me the same error with Apache, calling the
> authentication page works fine, however, when I try to pass the Cookie
> header field set to the saved cookie value, the socket keeps waiting
> for the response that never come.
> The same mechanism I used it with IIS server and it works with no
> problems,
>
> here is my login request header
> ----------------
> POST /admin/ProcessLogin.jsp HTTP/1.1
> Host: host
> Connection: CLOSE
> Accept: text/html
> User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
> Referer: http://host:8080/admin/index.html
> Content-Type: application/x-www-form-urlencoded
> Cache-control: private
> Content-Length: 44
>
> user_id=administrator&password=administrator
>
> ----------------
>
> Response header :
> ----------------
> HTTP/1.1 302 Moved Temporarily
> Date: Wed, 24 Jul 2002 23:49:38 GMT
> Server: Apache/2.0.36 (Win32) mod_jk/1.2.0
> Set-Cookie: JSESSIONID=893DE7C2176B3B10536D08D600FA419A;Path=/admin
> Location: http://host:8080/admin/AdminHome.jsp
> Content-Length: 0
> Connection: close
> Content-Type: text/html;charset=ISO-8859-1
>
> ----------------
>
> I then submit the my request for the other page:
> ----------------
> GET /admin/ListPages.jsp HTTP/1.1
> Host: host
> Accept: text/html
> Cookie: JSESSIONID=893DE7C2176B3B10536D08D600FA419A;Path=/admin
> User-agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
> Content-Type: text/html
>
> ----------------
>
> The socket keeps waiting and no response shows, I dont know where the
> problem is and I really appreicate it if you can help me with that
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org