12, October 2008

Question regarding your code - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Question regarding your code
« previous next »
Pages: [1] Print

Author Topic: Question regarding your code  (Read 905 times)
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« on: Feb 06, 2007, 05:40:16 PM »

Hi Olaf,
i have a question regarding the code and in particular the access_page method

Is it an obligation to connect to the database each time a protected page is viewed ?

i guess i'm missing something here, but i thought checking some session variable was enough to secure pages (once logged-in of course) ?

Thanks for your answer and your great script

Nitrixud
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8116
41653 credits
Members referred : 3



« Reply #1 on: Feb 06, 2007, 05:41:49 PM »

Session can be - in some cases - hijacked.

It depends on the security level that you require if you need a connection to the database or a session check on every pageview.

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Google dot what?
*
Posts: 2
16 credits
Members referred : 0


« Reply #2 on: Feb 06, 2007, 05:58:16 PM »

Thanks Nikolas, for your quick answer

@olaf, could it be a future feature ? if one want a simpler check just using session ?

or is it already there ?
using the $_SESSION['logged_in'] variable and just checking it ?

session_start();
if (!$_SESSION['logged_in'])
{
header ("Location: login.php");
}
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6349
38918 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Feb 06, 2007, 07:14:50 PM »

Thanks Nikolas, for your quick answer

@olaf, could it be a future feature ? if one want a simpler check just using session ?

or is it already there ?
using the $_SESSION['logged_in'] variable and just checking it ?

session_start();
if (!$_SESSION['logged_in'])
{
header ("Location: login.php");
}

sure you can use that session or just the other session's, but as Nick already mentioned session's are not really safe. Thats why I added an alternative session handler (this suggestion comes from official PHP people).


Last blog : Upload images for usage in TinyMCE
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=5965
Tags : session acess_page Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: Question regarding your code
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Oct 12, 2008, 06:03:04 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 36.906
Total Topics: 7.558
Total Members: 4.151
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: 22gigs

14 Guests, 5 Users online :

14 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.