sessions for default user auth. system?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Patriot
Forum Commoner
Posts: 34
Joined: Tue Jun 18, 2002 1:36 pm

sessions for default user auth. system?

Post by Patriot »

can sessions be used as a login/ register system? i mean, can you have multiple users login?
pretend you do this:


Logged.php>>

<?
if($submit) {
session_start();
session_register(user);
session_register(pass);
{

echo "Welcome $user, you are now logged in.<p>";
?>

without the "if name=/ if password="
would it do much different, and would this work for a user authentication script?
you would be able to send them across your site with a username, they choose, and will keep it until they log out.

of course, you wouldnt be able to restrict them from viewing pages without using flat-file or mysql, but it would atleast give them a chance to personalize their experience.

you could enter:
Name:
Password:
E-mail:
Website:

your first visit to the site, and then use them forever until you log out

or is there restrictions on how long sessions last? do they reset when you close the browser?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

here is an introduction to session-handling in php
There is also something about session/cookie lifetime-cycles
Post Reply