logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Video Tutorials
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 12-04-2006, 08:39 PM   #1
lux
 
Join Date: Apr 2006
Posts: 313
Default Log in script tutorial

Hey dj,

Excellent tutorials, very clear and easy to follow!

In the 3rd tutorial you use session_destroy(); to destroy all sessions. I want to build an application that multiple users will be accessing at once. What would you suggest as a method for removing a single session on logoff as apposed to all sessions?

Also would you be able to expand the tutorials to include the use of user profiles that may determine which pages a particular user may access based on their profile.

Cheers dj
__________________
"i was going to say that!" - davidj 2008
lux is offline   Reply With Quote
Old 12-04-2006, 08:54 PM   #2
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

session_destroy(); will only kill sessions that belong to a single user

its just a way to clear every session thats been set

as a applcations developer i could be using 30+ sessions and dont want to kill sessions 1 at a time. Just nuke em all at once using my BFG called session_destroy();

plus its a cool named function
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 12-04-2006, 08:56 PM   #3
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

Quote:
Also would you be able to expand the tutorials to include the use of user profiles that may determine which pages a particular user may access based on their profile.
yes thats a good one

will have something up before the weekend
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 12-04-2006, 09:03 PM   #4
lux
 
Join Date: Apr 2006
Posts: 313
Default

ok dj, my mistake.

so one session is for one page but if a user accesses more than one page a session is created for each page where session_start() is defined?
__________________
"i was going to say that!" - davidj 2008

Last edited by lux; 12-04-2006 at 09:04 PM.. Reason: poor English...
lux is offline   Reply With Quote
Old 12-04-2006, 09:16 PM   #5
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

in page 1 you have...

Code:
$_SESSON['user_name'] = "dj";
that session is accessable in every page below session_start(); and is available thoughout at anytime (you dont have to set this again!)

in page 3 you have...

Code:
$_SESSON['car'] = "Z4";
so at this stage you have 2 sessions set and can be used at any time no matter what page you are on
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:12 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com