By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,971 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,971 IT Pros & Developers. It's quick & easy.

Sessions. Argh.

P: n/a
Hi...

I'm trying my hardest to understand fully how sessions work and how best to
use them. However, all I can find is information that doesn't tell me
anything other than that sessions store information between pages, which I
knew already. I want to know HOW sessions work! If anybody has any good
links to material that explains sessions fully, then please send those links
this way!

I'm particularly interested in the session_set_save_handler() function, and
an in depth explanation of how PHP uses the provided functions. The PHP
manual does little to explain this. My problems are coming from trying to
impliment a session handling class, and for the life of me I cannot figure
out why and where the calls to my defined open, close, read, write, destroy
and gc functions are coming from!

Am I right in assuming that after I've used the session_set_save_handler()
function and provided it with the 6 functions it needs, all I need to then
do is use $_SESSION variables normally? For instance, if after I've called
session_set_save_handler() and I do this:

$_SESSION['required_info'] = "Sessions in PHP. Argh!";

then my custom functions will be called by PHP? Or have I totally
misunderstood everything?

P.

p.s. I am calling session_set_save_handler() with the appropriate
parameters, I just left them out for ease of reading.
Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
After much hacking and loss of hair, I have cracked it. The problem I was
having was with the difference between certain mysql_* functions and their
odbc_* "equivalents"

But I would still like to know any links to useful documentation about
sessions and security using sessions.

P.

"The Plankmeister" <pl******************@hotmail.com> wrote in message
news:3f***********************@dread15.news.tele.d k...
Hi...

I'm trying my hardest to understand fully how sessions work and how best to use them. However, all I can find is information that doesn't tell me
anything other than that sessions store information between pages, which I
knew already. I want to know HOW sessions work! If anybody has any good
links to material that explains sessions fully, then please send those links this way!

I'm particularly interested in the session_set_save_handler() function, and an in depth explanation of how PHP uses the provided functions. The PHP
manual does little to explain this. My problems are coming from trying to
impliment a session handling class, and for the life of me I cannot figure
out why and where the calls to my defined open, close, read, write, destroy and gc functions are coming from!

Am I right in assuming that after I've used the session_set_save_handler()
function and provided it with the 6 functions it needs, all I need to then
do is use $_SESSION variables normally? For instance, if after I've called
session_set_save_handler() and I do this:

$_SESSION['required_info'] = "Sessions in PHP. Argh!";

then my custom functions will be called by PHP? Or have I totally
misunderstood everything?

P.

p.s. I am calling session_set_save_handler() with the appropriate
parameters, I just left them out for ease of reading.

Jul 16 '05 #2

P: n/a
On Fri, 12 Sep 2003 15:35:01 +0200, The Plankmeister wrote:
After much hacking and loss of hair, I have cracked it. The problem I was
having was with the difference between certain mysql_* functions and their
odbc_* "equivalents"

But I would still like to know any links to useful documentation about
sessions and security using sessions.

P.

"The Plankmeister" <pl******************@hotmail.com> wrote in message
news:3f***********************@dread15.news.tele.d k...
Hi...

I'm trying my hardest to understand fully how sessions work and how best

to
use them. However, all I can find is information that doesn't tell me
anything other than that sessions store information between pages, which I
knew already. I want to know HOW sessions work! If anybody has any good
links to material that explains sessions fully, then please send those

links
this way!

I'm particularly interested in the session_set_save_handler() function,

and
an in depth explanation of how PHP uses the provided functions. The PHP
manual does little to explain this. My problems are coming from trying to
impliment a session handling class, and for the life of me I cannot figure
out why and where the calls to my defined open, close, read, write,

destroy
and gc functions are coming from!

Am I right in assuming that after I've used the session_set_save_handler()
function and provided it with the 6 functions it needs, all I need to then
do is use $_SESSION variables normally? For instance, if after I've called
session_set_save_handler() and I do this:

$_SESSION['required_info'] = "Sessions in PHP. Argh!";

then my custom functions will be called by PHP? Or have I totally
misunderstood everything?

P.

p.s. I am calling session_set_save_handler() with the appropriate
parameters, I just left them out for ease of reading.


Actually I'm a little suprised you didn't find much help in the Manual. I
keep a 'one page' html copy so I can search the entire document for
whatever is giving me fits. I just searched for 'session management'
about two days ago and found the info quite elaborate and helpful.. In
fact, I got a LOT more info than I needed.. but better too much than that
nagging feeling of 'not enough'.. :-(

Glad you found your answers..

Mike
Houston, Tx
.....................
Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.