![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
I just need someone to, in a simple way, describe sessions.
|
|
|
|
|
|
#2 |
|
Expert Programmer
|
Everytime someone connect to your web browser to be served data, your system can automagically and or manually create a session. What this does is assigns a unique session ID that your browser will pass to the webserver through HTTP1.1 headers, or through cookie headers (depending on what your browser supports).
This unique ID links directly to a file in a temporary directory on the server which is used to store variables and objects on the server between pages. The session is not destroyed until the users times out from the server (inactive browsing for a definite period of time, or you manually destroy the session). If a user logs into a webmail system, you would have to have the client constantly pass the password and username back into the server for every page reload, this is obviously very insecure, so instead you can store this data in the session ($_SESSION superglobal) which will allow the data to be used on different page view/scripts without passing the value back and forth between client and server. Also if they are purchasing items from your website, instead of storing the shopping cart, including full prices of the purchase on the client end (where they could modify it and rip you off) you would store it in the local session preventing the user from being able to do anything more then reference that session (with the session ID). Hopefully that clears things up for you...
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() |
sessions are handy.
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#4 |
|
Expert Programmer
|
Actually I try to keep as much data away fromt he client and in the SESSION data as much as possible, in theory this could help to prevent unseen bugs related to malformed request data... which happens all too often if you ask me.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|