• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cookies and FORM auth-method

 
Juarez Alvares Barbosa Junior
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am facing the following problem; I am using Struts and I am sending a cookie to client.
The cookie is being stored properly in the client computer when I do not specify a domain.
When the user return to my app, the first screen is my login page (using FORM auth-method).
When the user enters the app, the cookie is not being recovered. Just when he mades the first request in my app the cookie is recovered.
As far as I know this problem is related to setting the correct domain for my cookies.
I used Cookie.setDomain(".localhost") using naming convention as per RFC 2109 but this way the cookie is not set.
When I do not specify a domain the cookie file name is juarez@do[2].txt and its content is as below:
cookiePele
usa
localhost/jcurriculo/do/
1024
1612347520
29574130
1744838880
29568095
*
cookieIdioma
en_US
localhost/jcurriculo/do/
1024
1632347520
29574130
1767678880
29568095
*
I think the browser doesn�t understand in the login page that this cookie belongs to localhost/jcurriculo/do/, since in that page the HTML form element is <FORM METHOD="POST" ACTION="j_security_check">.
The browser doesn�t know what j_security_check is.
I am confused, tried several domain patterns and none worked.
Does anyone know what is going on ?
Juarez
 
Bala Murali
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this.
cookie.setPath("/");
All applications belongs to this particular server can access this cookie.
Rgds
Bala Murali
 
Bala Murali
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this.
cookie.setPath("/");
Set path only, don't specify domain value.
All applications belongs to this particular server can access this cookie.
Rgds
Bala Murali
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!