LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   hard question (well at least it is hard for me) (https://www.linuxquestions.org/questions/linux-networking-3/hard-question-well-at-least-it-is-hard-for-me-2666/)

dilberim82 05-21-2001 04:37 PM

Hey,
I have a webpage. I did not transfer it on my own server yet but i am thinking about transfering it soon. I have a couple of problems. I want people to sign up for an account and get a sign in name. They should be able to sign in and stay signed in for a couple of hours and if they are idle for 2 hours they should be disconnected from the server automatically. I dont know how to set it up that way. Any how-to's is appreciated.

trickykid 05-21-2001 05:14 PM

I am not really good at programming but I am sure there are many ways to do this with some sort of scripting language and cookies maybe involved. This question should more like be in the programming forum. You could probably do this with Perl, maybe Javascript or even VBscript and others.

dilberim82 05-22-2001 06:46 AM

thanks
 
I know a little about java but i dont know anything about Perl or VB. I was wondering if there are any free programs i could borrow. And my question is not really about how to write the program, i dont know how and where to put the code in linux and be secure that i wont be hacked. trickykid do you know any websites or books that would help me with it? Thanks again for replying.

trickykid 05-22-2001 07:00 AM

i guess something like that would be included in a separate folder with limited access rights to it. I know some when setting up their web sites have like a private directory.
Not sure of any sites though, if I come across any, I will let you know. You could check out the main sites though, like http://www.perl.org or http://www.javascript.com .

jrockey 05-25-2001 01:51 PM

When you say "account" do you mean an account on your web site or an account on your Linux server? If you mean on your Linux server, I don't know how to arrange to kick people off after a certain time, but I am sure there is one.

If you mean on your web site - i.e. "sign in" like people sign in to Hotmail - then the way to do it is via "session management". Java provides session management as part of the servlet API (check out documentation on the Sun site). Behind the scenes, it's managed using either cookies, which you can set to expire after two hours, or in a more complicated manner by creating a unique ID when the user signs in and recording it a database and passing the ID as a URL parameter for every request the user makes. Every time the user makes a request you reset the time on the database entry.

The Java classes make all this quite easy.



All times are GMT -5. The time now is 10:08 AM.