0

How can I get session value when there's no set-cookie in response header like this site ?

I've already read other question, but I can't solve it.

When cookie's cache-control value is max-age=0, how can I maintain the session to hold status logged in?

Please, somebody help me.

Community
  • 1
  • 1
Hyemi Min
  • 41
  • 1
  • 8
  • It's possible that the server could be setting the cookie using client-side scripting, such as javascript's `document.cookie`. Then, on subsequent requests from the browser, this browser includes the cookie id in the headers of http requests. This is how some older web sites handle cookies - for example www.pacer.gov. – mti2935 Feb 13 '15 at 21:27
  • @mti2935 Actually, I want to make java program that can login to website automatically. I'm using HttpURLConnection to send request ,get session and send post. `conn.setRequestMethod("GET"); conn.setRequestProperty("User-Agent", USER_AGENT);` like this. How can I set cookies which are in client-side or request when I send Post? – Hyemi Min Feb 13 '15 at 21:58
  • I couldn't tell you how to do it in java. But, in `curl`, you can do so using the `--header` option. See http://stackoverflow.com/questions/356705/how-to-send-a-header-using-a-http-request-through-a-curl-call – mti2935 Feb 14 '15 at 00:10

0 Answers0