This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Session problem while trying to login automatically into app using httpunit API  RSS feed

 
Shubh Garg
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/*

Hi,

I need help regarding the following code that I have tried to use. I'm trying to login into an application automatically by running this code using httpUnit API. I have a login page where I'm required to input username & password & also have a submit button. I'm successfully able to do this but when the form is submitted & when my I.E. 7 / Chrome 8 browser opens up, it doesn't redirect to the main page after logging-in. Instead, it gives an error "your session has been expired,please login again" which is an application generated error. I tried to debug with various statements & came to know that I'm being successfully authenticated & reaching the right page when i apply getText() methods but the session is getting expired. Also when i check the header information, it is displaying same JSESSION ID every time for the cookie . I'm not able to understand how to rectify this problem.


The code is working fine. You need to use the following jar files: httpunit-1.6.jar, Tidy.jar, js.jar & xmlParserAPIs.jar. And also u'll have to give a login page url with the form name along with the username & password values (their form names also) to set their values in the form.

I request you all to help me out with the same & give me a solution since I need to get through it quickly.


*/



//Thanks.
 
Kevin Workman
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BeForthrightWhenCrossPostingToOtherSites

Crossposted here.
 
Shubh Garg
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks..i get your point...sure is valid..but I'd make sure that I close all my topics once I get the solution or when I have got off it.
 
Rob Spoor
Sheriff
Posts: 21047
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Please UseCodeTags next time. I've added them for you this time.
 
Shubh Garg
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot...am a newbie out here...so less familiar wid stuff out here...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!