Can I access session variables after using a httpsURLConnection call?
Posted on 2004-04-14
I am a first time poster and new to web programmer so forgive my ignorance.
I have a secure web site where a user logs in with a username and password. This is saved in a session variable named credentials. As the user process information, he wants to be able to save the information to the server in html file to be able to access that data at a later date. I have written a servlet that will do this (right now it is only writting to standard out).
The problem is that the first thing the jsp page does is check for the credentials session variable to make sure the user is logged into the site. I have lost this session variable using the HttpsURLConnection. Is there any way to pass this in? Or is there better way to do this?
HttpsURLConnection.setDefaultHostnameVerifier( hnv );
String urlString = request.getParameter("urlString");
URL formUrl = new URL(urlString);
HttpsURLConnection connection = (HttpsURLConnection)formUrl.openConnection();
System.out.println("OPEN CONNECTION SUCCESSFUL: "+formUrl);
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
while ((inputLine = in.readLine()) != null)