Please advise if there is a better topic area to post this ...
Background:
I have over 30 years experience programming in various languages, but web programming is new to me.
I am developing a website without using any tools. The html is all hand written, and the server side application is also hand written, mostly in c-language, with some perl.
One of the features I need to implement is to allow registered users to login, giving them access to thier personal account information. I have developed a client page that posts (via https) a form with a username and password. For test purposes, the service currently validates the user/passwd against accounts saved in a flat file stored on the server above the web root, and responds with the user's requested information.
Problem:
I do not know how to establish a session between the server and the browser to enable the user to continue thereafter in an authenticated state. One way to do this would be for me to pass an encrypted session key back and forth at the application level, but I believe that kind of logic is already implemented in the infrastructure and I don't want to reinvent the wheel.
I am guessing the right way has something to do with htaccess and/or htpassword; And I suppose there must be some api (?) to inform the Apache webserver that the session is authenticated ... Am I even close?