Ajax POSTS fail with 404 until page is reloaded

80 views
Skip to first unread message

Dave (“Bric”) Briccetti

unread,
Jul 30, 2011, 1:50:04 AM7/30/11
to lif...@googlegroups.com
Here's something new in our application. If you start a browser and open a page, then push an ajax button on that page, the post will fail with a 404. This will continue until you reload the page. Then ajax works on all pages normally. To make it recur, restart the browser. Something to do with HTTPS, maybe? Firefox 5 and Safari 5.0.3 on Mac.

GET https://192.168.128.204:8443/um/index

Server: Apache-Coyote/1.1
Pragma: No-cache, no-cache
Cache-Control: no-cache, no-cache, private, no-store
Expires: Sat, 30 Jul 2011 05:30:43 UTC
Set-Cookie: JSESSIONID=477B8541866974CE28568738BFA78F1A; Path=/um/; Secure; HttpOnly
Date: Sat, 30 Jul 2011 05:30:43 GMT
X-Lift-Version: 2.4-M2
Content-Type: application/xhtml+xml;charset=utf-8
Content-Length: 3195

POST https://192.168.128.204:8443/um/ajax_request/F5449275634392VCSCD/
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 1063
Date: Sat, 30 Jul 2011 05:30:55 GMT

type Status report

message /um/ajax_request/F5449275634392VCSCD/

description The requested resource (/um/ajax_request/F5449275634392VCSCD/) is not available.
Apache Tomcat/7.0.14

David Pollak

unread,
Jul 30, 2011, 4:33:42 PM7/30/11
to lif...@googlegroups.com
Dave,

Just a guess, but I'm betting that the HttpOnly flag is causing the problem.  The POST does not contain a Cookie header... likely because the client doesn't have access to the JSESSIONID cookie.

But that's just a guess.

Thanks,

David


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To view this discussion on the web visit https://groups.google.com/d/msg/liftweb/-/3kc8lhC7hJ4J.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



--
Lift, the simply functional web framework http://liftweb.net

Dave (“Bric”) Briccetti

unread,
Aug 6, 2011, 2:15:07 AM8/6/11
to lif...@googlegroups.com
Thanks, David. I created a META-INF/context.xml

<?xml version='1.0' encoding='utf-8'?>
<Context useHttpOnly="false">
</Context>

We’ll see if that solves the problem.

Dave (“Bric”) Briccetti

unread,
Aug 6, 2011, 2:49:42 PM8/6/11
to lif...@googlegroups.com
I was using HTTP Basic auth as a temporarily solution, and I think that’s a factor in this (HTTPS and HttpOnly is not). If there’s an easy fix, I would like to get going quickly, otherwise I will build in a proper login inside the Lift app. Notice the session ID cookie the garbage collection Ajax call makes is not the one from Set-Cookie.

GET http://192.168.128.201:8080/um/

Host: 192.168.128.201:8080
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Authorization: Basic YWRtaW46cGFzc3dvcmQ=


Server: Apache-Coyote/1.1
Pragma: No-cache, no-cache
Cache-Control: no-cache, no-cache, private, no-store
Expires: Sat, 6 Aug 2011 18:13:17 UTC
Set-Cookie: JSESSIONID=62F0D0045D14DB9C3DA7784A53185AFD; Path=/um/
Date: Sat, 06 Aug 2011 18:25:34 GMT

X-Lift-Version: 2.4-M2
Content-Type: application/xhtml+xml;charset=utf-8
Content-Length: 3197


http://192.168.128.201:8080/um/ajax_request/F469992267113RP1VCJ/?__lift__GC=_

Host: 192.168.128.201:8080
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Accept: text/javascript, application/javascript, */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://192.168.128.201:8080/um/
Content-Length: 12
Cookie: JSESSIONID=409CA082764AA88A504367CFD5A7ADEE
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Pragma: no-cache
Cache-Control: no-cache


Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Length: 1063
Date: Sat, 06 Aug 2011 18:26:50 GMT

<html><head><title>Apache Tomcat/7.0.14 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /um/ajax_request/F469992267113RP1VCJ/</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/um/ajax_request/F469992267113RP1VCJ/</u></p><p><b>description</b> <u>The requested resource (/um/ajax_request/F469992267113RP1VCJ/) is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.14</h3></body></html>

Dave (“Bric”) Briccetti

unread,
Aug 7, 2011, 4:10:42 PM8/7/11
to lif...@googlegroups.com
I removed the HTTP basic auth, so this is no longer an issue.
Reply all
Reply to author
Forward
0 new messages