Coding a PHP Login System

digitalpower

BANNED
Joined
Dec 16, 2008
Messages
303
Reaction score
70
I am working on a PHP login system but I am stumped. The system right now can do the following:

1) User can create an account
2) User can confirm their e-mail address
3) User can login to the account and see member-only pages

The problem is that once a user logs in and sees the web pages that only registered users can see, they can only see it once. Once they leave the page, they have to login again. I know you have to use $_SESSION and session_start() but I am confused. Can someone please assist? Also, if there is an already developed login system for PHP that is similar to the ASP.NET 2.0 Membership system, can you please let me know?
 
you mean if he leaves the members area? use a cookie
 
Well php sessions use cookies to, but those cookies expire when you close you browse (unless you set ... session.cookie_lifetime)

http://si2.php.net/manual/en/session.configuration.php

session.cookie_lifetime integer
session.cookie_lifetime specifies the lifetime of the cookie in seconds which is sent to the browser. The value 0 means "until the browser is closed." Defaults to 0. See also session_get_cookie_params() and session_set_cookie_params().

But be careful, you can kill your server if you store to much sessions for long time, or even better, use sessions for login and stuff like that and only cookie for autologin.
 
I have an old php login system that was plug and play, i did email it to someone but I cannot find it on any of my systems. I'll grab some of my backup discs out tommorow and look on them for ya.
 
Hay lokiceo need some help with a php membership site manager script.. I posted a repled to this thread "
[h=3]Ask me Any Questions about Membership Sites"[/h]I am using Membership site manager script for my members site and wanted to know if there is a special way to call the login and logout for teh site..... What i mean is my site has a login form on it and it is pointed to the members area but when you click login you get a small broswer window that asks for the same info then logs in. want to know how to find the file to call on login and out from inside the site plus show username of signed in user I am using the install file as a guide and used a shortcode they gave that works only in emails it seems.. Could use some help with this I have searched the net and have yet to find an answer.... that works.. for a login form, logout link and username dispaly.... thanks in advance..
 
Back
Top