On Wed, 17 Dec 2003 16:29:56 -0500, Jeffrey Silverman
<jeffrey@jhu.edu> brought forth from the murky depths:
[color=blue]
>On Wed, 17 Dec 2003 12:25:30 -0800, jing_li wrote:
>[color=green]
>> Hi, you all,[/color]
><snip>
>I am wondering if there is a way to specify where[color=green]
>> to save the session variables on the local machine so later the users
>> can open multiple browsers to lead to different branches of our web
>> site without mixing session variables.
>>
>> Thanks in advance,
>>
>> Jing[/color]
>
>Suggestions:
>
>1) Try using unique name spaces for your session variables. PHP doesn't
>really support name spaces but you can fake it. For example, put all of
>your session variables in an array an name that array $_JING_SESS and he
>does the same and puts his in $_HISNAME_SESS. Then you get the values for
>whatever by $_JING_SESS['whatever'] and he does likewise. You can facke
>name spaces in other ways as well (but I can't think of 'em offhand).[/color]
Hmmm, interesting. I have a client who wants me to stack carts on a
page so her commercial clients can do all their shopping in one trip.
The ASP equivalent she wants me to clone in PHP is the business gift
style at
http://www.godiva.com . You can get several items for one
client, then start another cart before checking out, later sending
batches of gifts to several people with different messages for each
batch. I wonder if they're doing something like you mention here,
but with different session names. (They have changed their setup and
cart flow since she and I first discussed it, and, checking again
tonight, I see that it is changed yet again.) The problem I see with
it is getting the cart page to grab all session data and blend it on
that and subsequent pages for checkout. Sessions are usually meant for
a single entity and follow through semi-linearly.
Yes, I know this is a sidestep from the OP's question but it appears
that handling might work in the same fashion.
(Remember this one, Rajesh?)
[color=blue]
>2) Put the sessions in a database. I found a good tutorial for this here:
>
http://phpbuilder.com/columns/ying20000602.php3[/color]
Has anyone else noticed that not a single one of their book links
works on the Linux Central site? After entering some titles into
the LC search box and coming up empty, LC obviously doesn't carry
_any_ of the books they refer to. Very strange. I wonder whose DB
they're tracking. <vbg> They don't ACK mail on it, either.
Hmm, he calls this a handler and uses it for multiple
[color=blue]
>I put sessions for each Web application I create in a completely
>diffeerent database. That way there is no overlap.[/color]
Why use a database for session data, or are you merely catching
that as well as the "good stuff" such as order data?
[color=blue]
>3) Google a bit. This problem has been seen and solved by others. I
>guarantee it.[/color]
Good idea. I (too) often forget how useful Google, et al, can be.
--
Remember: Every silver lining has a cloud.
----
http://diversify.com Comprehensive Website Development