SunQuest
           PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

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 Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 13th, 2008, 04:14 PM
Pabs Pabs is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Canada
Posts: 100 Pabs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 52 m 22 sec
Reputation Power: 2
Security and SESSION

I'm building a site which will have a control panel for the admin users so that they can update news items. events, etc. also be able to remove data from the DB.. .that's why I'm a little paranoid...adding stuff can always be removed...if they get in and start deleting records....that's bad

obviously I only want the Admin users will have access to this..
now.. I have a login page and in that file I set a session var called "permission" to true if the user has been verified (via a DB check). or false or null if user name and pass don't match.

in every page I need to have secured info in I simply check if that session variable is set to true...if it is display the info if not I redirect to the log on screen...
the start of my file would look like this (any secure file):

PHP Code:
<? startMysession();
if(!
session_is_registered('permission')) :
header('Location: index.php');
endif;
show_secure_content(); //secure content here (only go here if the if failed)

?>



it works fine... I'm just wondering if that can actually be "cracked"?
it seems so simple...yet I'm not sure how you could hack it...
am I safe or should I add another level of security?

thanks
Pabs

Reply With Quote
  #2  
Old May 14th, 2008, 08:49 AM
RevRaz RevRaz is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 8 RevRaz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 16 m 20 sec
Reputation Power: 0
Of course anything is possible, but your method is pretty safe. As long as you have register globals turned off, you should be fine.

Quote:
Originally Posted by Pabs
I'm building a site which will have a control panel for the admin users so that they can update news items. events, etc. also be able to remove data from the DB.. .that's why I'm a little paranoid...adding stuff can always be removed...if they get in and start deleting records....that's bad

obviously I only want the Admin users will have access to this..
now.. I have a login page and in that file I set a session var called "permission" to true if the user has been verified (via a DB check). or false or null if user name and pass don't match.

in every page I need to have secured info in I simply check if that session variable is set to true...if it is display the info if not I redirect to the log on screen...
the start of my file would look like this (any secure file):

PHP Code:
<? startMysession();
if(!
session_is_registered('permission')) :
header('Location: index.php');
endif;
show_secure_content(); //secure content here (only go here if the if failed)

?>



it works fine... I'm just wondering if that can actually be "cracked"?
it seems so simple...yet I'm not sure how you could hack it...
am I safe or should I add another level of security?

thanks
Pabs

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Security and SESSION


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway