Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how does the login process on most sites work?

Status
Not open for further replies.

ankursaxena

Programmer
Sep 7, 2001
133
US
Hi! i have to create a personal settings site for the intranet. i want to be able to be login in, which is ok, but then have session timeout also expiration of pages and pass username all around.

if someone could help me with this it would great thanx.
also if someone could tell me typically how does any login enabled sites work? do they work with cookies? rnt cookies unreliable or a security problem?

thanx in advance.

-Ankur
 
To set the session timout period place this bit of code in after username/password verification. This sets the amount of time in seconds that the session will exist without any activity.

session.setMaxInactiveInterval(3600); //60 minutes

To enable the username to be accessable from all of your pages the following code should also be placed after username/password verification.

session.setAttribute("Username",username);

then to access it from any other page use, type casting is important.

(String)session.getAttribute("Username");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top