How to create a form that use HTTPS?


I need to get some secure cookies from a browser when a user push a button at a form. But how do I tell the form to use HTTPS?

Is this a common solution:

<form action="" method="post">

or is should a give the form some other argument?

When I use the above the browser says that it can not create a connection to the server. But perhaps I need to install some certificate at the server?

I use webserver orion 2.0.2 so if any one could give some clues it would be great!

Best regards

when I set a cookie I do it like:

Cookie cookie2 = new Cookie("int_2_name_secure", (String)form.get("cookie_value"));

Is there some method that can tell me if it is possible to set cookies like isCookiesEnable() ... I have not found any?
Who is Participating?
TimYatesConnect With a Mentor Commented:
> Is this a common solution:

I think so...  But a more common way of doing it is to have the page that the form is posted from being on https too

that way, the user can see that the page is encrypted before they post their data (a page asknig for important details that is not on https is likely to be not used)

And is an example of cookie checking :-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.