Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 131,679 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 2,484 people online right now. Registration is fast and FREE... Join Now!




Using sessions for security

 
Reply to this topicStart new topic

Using sessions for security, Are they the best or only option

swichnz
post 8 Oct, 2008 - 12:59 AM
Post #1


New D.I.C Head

*
Joined: 5 Sep, 2006
Posts: 17


My Contributions


I am building a website and want users to able to be to log on, manage certain things to do with their accounts but I am not dealing with credit cards or anything that major. I want to enable a login function and allow the users to change personal details etc. All I want is reasonable level of security to stop some idiot from somehow getting in modifying acounts in a way that looks bad and unprofessional for the web site.

What I am curious about is if I am using PHP is sessions the best and or only way to go about this, I am only asking because I would like to know before I start with sessions that there is no other option that would better meet my nneds that is available to me that I can't find.

Thanx in advance biggrin.gif
User is offlineProfile CardPM

Go to the top of the page


pemcconnell
post 8 Oct, 2008 - 01:39 AM
Post #2


D.I.C Regular

Group Icon
Joined: 5 Aug, 2008
Posts: 392



Thanked 35 times

Dream Kudos: 75
My Contributions


Yeah sessions are pretty much the standard way of securiing areas of a site. You can also use cookies and (eek) post data, but I'd recommend the session approach
User is online!Profile CardPM

Go to the top of the page

William_Wilson
post 8 Oct, 2008 - 03:29 AM
Post #3


lost in compilation

Group Icon
Joined: 23 Dec, 2005
Posts: 3,951



Thanked 13 times

Dream Kudos: 3275

Expert In: Java, C, Javascript

My Contributions


post data isn't all bad, but you must verify it is a reasonable response server side, trusting users is never a good idea. Cookies aren't really a good way to go, they would protect against the common user, but these are not the users you are worried about. Anyone with a little computer knowledge knows how to delete cookies and it only takes google to learn to modify them.

Sessions are very handy and not that hard to use. If you want to create a login system in php, they are your best option.
User is offlineProfile CardPM

Go to the top of the page

swichnz
post 9 Oct, 2008 - 02:41 AM
Post #4


New D.I.C Head

*
Joined: 5 Sep, 2006
Posts: 17


My Contributions


Thanks guys, that was exactly the info I was looking for. icon_up.gif
User is offlineProfile CardPM

Go to the top of the page

akozlik
post 9 Oct, 2008 - 06:59 AM
Post #5


D.I.C Addict

Group Icon
Joined: 25 Feb, 2008
Posts: 586



Thanked 22 times

Dream Kudos: 750
My Contributions


Plus with cookies, they actually have to be allowed by the browser. If a user isn't allowing cookies, they won't be allowed to login, as the cookie never gets set.

You might also be interested in the following tutorial:

To Session or to Cookie

Hope that helps and good luck!
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/20/08 07:39AM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month