Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 1st, 2005, 9:57 PM   #1
MikeC
Newbie
 
Join Date: Nov 2005
Posts: 5
Rep Power: 0 MikeC is on a distinguished road
Php Login System

Allright well a login system is what I have to do next... So To start I have a question. How does the code know that your logged in?
MikeC is offline   Reply With Quote
Old Dec 1st, 2005, 11:44 PM   #2
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
a cookie or a session. Cookie is the most preferred.
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Dec 2nd, 2005, 1:00 AM   #3
MikeC
Newbie
 
Join Date: Nov 2005
Posts: 5
Rep Power: 0 MikeC is on a distinguished road
Ah i see...
MikeC is offline   Reply With Quote
Old Dec 2nd, 2005, 1:46 AM   #4
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4 Arevos is on a distinguished road
Quote:
Originally Posted by Lich
a cookie or a session. Cookie is the most preferred.
Er... You mean a cookie or a GET/POST variable?

A session is a device which ties a series of HTTP requests together, using a cookie or GET/POST variable.
Arevos is offline   Reply With Quote
Old Dec 2nd, 2005, 9:19 AM   #5
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
Quote:
Originally Posted by Arevos
Er... You mean a cookie or a GET/POST variable?

A session is a device which ties a series of HTTP requests together, using a cookie or GET/POST variable.
The script knows you're logging in via a get/post variable, but I was talking about how once you're logged in the system knows that by a cookie or session variable
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Dec 2nd, 2005, 10:04 AM   #6
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4 Arevos is on a distinguished road
Quote:
Originally Posted by Lich
The script knows you're logging in via a get/post variable, but I was talking about how once you're logged in the system knows that by a cookie or session variable
Session ID are usually carried in cookies, with GET/POST variables as fallbacks. I suspect what you mean is that one shouldn't put login information directly into a cookie, and you'd be right. But don't think that sessions don't use cookies.
Arevos is offline   Reply With Quote
Old Dec 2nd, 2005, 11:41 AM   #7
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
Quote:
Originally Posted by Arevos
Session ID are usually carried in cookies, with GET/POST variables as fallbacks. I suspect what you mean is that one shouldn't put login information directly into a cookie, and you'd be right. But don't think that sessions don't use cookies.
I know they do, but it's more like a cookie variant and they aren't stored in the same place ($_COOKIE[] and $_SESSION[] respectively), I was simply differentiating for the sake of showing it.
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Dec 2nd, 2005, 12:06 PM   #8
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4 Arevos is on a distinguished road
Quote:
Originally Posted by Lich
I know they do, but it's more like a cookie variant and they aren't stored in the same place ($_COOKIE[] and $_SESSION[] respectively), I was simply differentiating for the sake of showing it.
Bleh. You confused me :p
Arevos is offline   Reply With Quote
Old Dec 2nd, 2005, 12:08 PM   #9
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
Quote:
Originally Posted by Arevos
Bleh. You confused me :p
my bad
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Dec 2nd, 2005, 11:49 PM   #10
Mocker
Hobbyist Programmer
 
Mocker's Avatar
 
Join Date: Oct 2005
Location: Indiana
Posts: 202
Rep Power: 0 Mocker is an unknown quantity at this point
Send a message via AIM to Mocker
the webserver has a setting for php which decides to store sessions as cookies only, or as cookies first and get/post as fallback, or just get/post. GET is pretty insecure to have your information in.
Normal login steps are.
Have a form to enter login information
Send form via POST to a php script
Have the php script verify login information
Have the script start a session (search for session at php.net for functions) with your username or some other identifier
Whenever you need to use that information, access it through $_SESSION['variable']
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi
freelance scripts - http://ryanguthrie.com/index.html
Mocker is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:56 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC