Archived:Panic in S60 3rd Edition FP1 devices if the Set-Cookie header is empty (Known Issue)
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.
Article Metadata
Compatibility
Platform(s): S60 3rd Edition FP1
Article
Created: User:Technical writer 1
(04 Jul 2007)
Last edited: hamishwillee
(28 Jun 2012)
Description
On Nokia S60 3rd Edition FP1 phones and emulator, the USER 44 or USER 45 panic is thrown while connecting to a remote server. The error is based on low-level parsing of the response which is caused by an empty Set-Cookie property in the header. If the header is removed or set to a non-empty string, no panic is raised and the application works fine.
How to reproduce
Build a dummy servlet with the Set-Cookie header set to an empty string:
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String test="Testing...";
response.setContentType(content_type);
int length = test.getBytes().length;
response.setContentLength(length);
response.setHeader("Set-Cookie", "");
PrintWriter out = response.getWriter();
out.println(test);
out.close();
}
Solution
Do not leave the Set-Cookie header empty.
Set-Cookie: \r\n -- crash
Set-Cookie: foo\r\n -- no crash
Set-Cookie: foo=bar\r\n -- no crash


(no comments yet)