• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Cookies

 
ishwar shah
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to acces a website. I have username and Password for the same.
What i am doing is accessing the website. Taking the cookie and sending it againg with username and password to reach deeper in the site.

But it is giving that access permission not granted.
It seems it is not receiving the cookie.

Can anyone please help me over the same.

I am using, HTTPS URL Connection.
 
Rob Spoor
Sheriff
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure the site is using cookies for authentication? Perhaps you need to use POST data each time. Or the security is built into the web server.

In the former case you'll need to send the post data:


In the second case you'll have to use an Authenticator:
 
ishwar shah
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Rob.
I appreciate that.

But I guess my query was bit unclear.
THe thing is I am able to get my Username and Password through, but the session is not being maintained.
For instance, It behaves exactly in the same manner if you Block Cookie Acceptance from Browser viz: IE or Mozilla.

So the problem is - Session Is Not Getting maintained because ,
The Second URL is NOT RECEIVING MY COOKIE ITSELF.
 
ishwar shah
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob,
Yes i am sure about the site using cookies for maintaining session.

And I am using POST Method.
 
Rob Spoor
Sheriff
Pie
Posts: 20555
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using HttpClient from Apache.
 
Anjanesh Lekshminarayanan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When using PHP + cURL, we can set the file-location of the cookie file to store the cookies.

This way, when the program (or another program) is run again and connects to the same URL, it can get the cookies from cookie.txt.

Is something like this possible via the java.net.* library (JDK 6) ?
[ December 09, 2007: Message edited by: Anjanesh Lekshminarayanan ]
 
Malayathi Partha Saradhi
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ishwar, please check the browser wheater it supports cookies or not.
check SECURITY TAB IN BROWSER,in which cookies radio button is enabled or disabled.
 
ishwar shah
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies guys,

Yes the browser does accept cookies. As matter of fact it is quite advanced.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic