sessions... basic questions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the setting in found in php.ini under the session section.
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post by pedrotuga »

thank you ;)
User avatar
pedrotuga
Forum Contributor
Posts: 249
Joined: Tue Dec 13, 2005 11:08 pm

Post by pedrotuga »

Code: Select all

function check_session(){

if ($_SESSION['islogged'] != true){
	die("not logged in!!");
}
what about this... i want to use this function to check user authentication... should i pass the variable by parameter or should i just get it from the $_SESSION array?
Or should i right a little script with this code and include it whenever i want?
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

Whatever you'll do... use '!==' instead of '!='. This way the code is more secure and it should be faster as well 8)
Post Reply