Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6216665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:17:21+00:00 2026-05-24T07:17:21+00:00

Using HttpURLConnection and doing post to the server I obtain the redirect page with

  • 0

Using HttpURLConnection and doing post to the server I obtain the redirect page with the location header. Status code 302, so I must use this information to proceed to the redirect. (Everything seems to be ok here.. at least for me)

08-03 09:45:11.662: INFO/System.out(1664): <html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="http://website/mobile/(X(1)S(sf3dah5520rblujg4z2n0n55))/Login.aspx?ReturnUrl=%2fsyspower3%2fmobile%2fDefault.aspx&amp;AspxAutoDetectCookieSupport=1">here</a>.</h2>
</body></html>
08-03 09:45:11.662: INFO/System.out(1664): Status code - 302
08-03 09:45:11.672: INFO/System.out(1664): location : [http://website/mobile/(X(1)S(sf3dah5520rblujg4z2n0n55))/Login.aspx?ReturnUrl=%2fsyspower3%2fmobile%2fDefault.aspx&AspxAutoDetectCookieSupport=1]
08-03 09:45:11.672: INFO/System.out(1664): x-powered-by : [ASP.NET]
08-03 09:45:11.672: INFO/System.out(1664): content-type : [text/html; charset=utf-8]
08-03 09:45:11.672: INFO/System.out(1664): content-length : [282]
08-03 09:45:11.672: INFO/System.out(1664): date : [Wed, 03 Aug 2011 09:45:00 GMT]
08-03 09:45:11.672: INFO/System.out(1664): server : [Microsoft-IIS/7.5]
08-03 09:45:11.672: INFO/System.out(1664): location found: http://website/mobile/(X(1)S(sf3dah5520rblujg4z2n0n55))/Login.aspx?ReturnUrl=%2fsyspower3%2fmobile%2fDefault.aspx&AspxAutoDetectCookieSupport=1

After this, if i use this link in the normal browser, i can go into the server without logon, so practically this link is the one i should use to make a post to and obtain the information that is inside the server after the logon. (And it actually does it if I use it in browser)

Problem:
If i do the new POST to the server already with the new location, i get to the logon screen again.
Should I be using cookies for the new request or what is my problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:17:22+00:00Added an answer on May 24, 2026 at 7:17 am

    Yes, cookies should solve your problem.
    When you are working with browser you get Set-Cookie response header when you go to the site first time. Then when you continue the browser sends header Cookie with all cookies in it.

    One of cookie contains HTTP session ID. For example java based servers use cookie jsessionid. This cookie is used by server to identify your session when you perform second, third etc request. If this field is absent server creates new session every time. The session is new, therefore is not authenticated, so you are redirected to login page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i can establish a connection using HttpUrlConnection. my code below. client = new DefaultHttpClient();
I want to make some API calls to a server using HttpURLConnection . But
I have an application that is using the HTTPUrlConnection to POST soap envelopes to
I'm working on application which has workflow like this: 1.parsing home page (using HttpURLConnection,
I'm trying to write to a text file on my web server using HttpURLConnection.getOutputStream().
What is the best way to use preemptive basic http authentication using HttpUrlConnection. (Assume
I need to download Base64 Encoded data from Server using HttpUrlConnection. And then decode
I am using the following code to download a file from my server then
I am using the code shown below to get Data from our server where
Using PyObjC , you can use Python to write Cocoa applications for OS X.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.