PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 13th, 2000, 04:38 AM
till till is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Posts: 7 till User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm tryin to figure out a way, how to make sure a user logged in, over a web form. I have a subdir "users" that should only be accessed when the user logged in using a form. I heard cookies wouldn't be a good choice and someone told me about "php auth", but i didn't find anything about that in the docs.

I appreciate any help.


Till

Reply With Quote
  #2  
Old January 13th, 2000, 06:40 AM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 17
Send a message via AIM to rod k
Cookies are fine if the user doesn't have them disabled.

All you need to do is create a session identifier that can be passed from page to page, via POST, GET or cookie. Using md5() hashes is about as secure as you can get. When you process the login, you can create a unique session id by using this:

$session=md5(uniqid($uname));

where $uname is the users name. Store this info along with the users id, name or whatever and a timestamp in a table or flat file. Pass $session from page to page and at the top of each page verify that $session is valid in the table and that the current time is not too long since the timestamp was updated. If it is you can have them log in again. If not, update the timestamp to the current time and display the page.

Often, for added security, you can use the IP address of the visitor to make sure no one is using the same current session id. Beware, people connecting via proxies can have IPs that change between page views, however, it is unlikely that the IP will change outside of the lowest level (e.g. in the IP 111.222.33.44, 111.222.33 should remain constant). So you could check only those portions of the IP.

Reply With Quote
  #3  
Old February 10th, 2000, 04:01 PM
Condor72 Condor72 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Culver City, Ca
Posts: 6 Condor72 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I have no problem using MD5. What I need is to encode a url with a shared secret key using HMAC-MD5 security algorithms. I can't find any information about this using PHP. I tried:

$signature = md5("$urltosign $sharedkey");

This routine does return a value for signature that looks right but the server won't accept it as valid. I have C++ code that will do this and have seen perl scripts too but I want to stay open-source. Is there anything I can do? Is there a <javascript> way to do this?


Reply With Quote
  #4  
Old February 10th, 2000, 04:56 PM
rod k rod k is offline
Apprentice Deity
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Jul 1999
Location: Niagara Falls (On the wrong side of the gorge)
Posts: 3,237 rod k User rank is Private First Class (20 - 50 Reputation Level)rod k User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 m 8 sec
Reputation Power: 17
Send a message via AIM to rod k
I believe that functionality will be in PHP4.

Reply With Quote
  #5  
Old February 16th, 2000, 03:36 PM
F.Schaper F.Schaper is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Bremen
Posts: 11 F.Schaper User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to F.Schaper
Hmmm if u want your users to use a portal page this is a nice sollutions otherwise use the basic authorisation from apache or better PHP for it ang check for the $PHP_AUTH_USER ... if set your user has provided a password for the page But be aware for a bug in the IE5 that allows it to workaround the basic authorisation of a page if a user once logged in on the same machine ... just in case u have sensible data on it ...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > authorization

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap