如何区分多个会话? [英] How to differentiate multiple sessions?

查看:53
本文介绍了如何区分多个会话?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我是php的新手,我需要你的帮助。我的一个同事和我

都在使用php开发我们项目的网页。我们在服务器上的不同位置有相同文件的

副本(在我们自己的同一台机器上的
帐户中)。当我使用相同的浏览器测试两个版本的

程序时(Windows上的IE或Linux上的Konqueror)

会话变量将混淆,只有最新的选择或
将显示
选项。如果我来回使用Previous

和Next我们页面上的按钮不仅来自我的页面的变量

将从他的页面更改为变量,而且我的页面也将跳转到他的页面上的
。我想知道是否有办法在本地机器上指定保存会话变量的地方

以后用户

可以打开多个浏览器导致不同的分支机构我们的网站

网站没有混合会话变量。


提前致谢,


Jing

解决方案

2003年12月17日星期三12:25:30 -0800,jing_li写道:

大家好,
< snip>

我想知道是否有办法指定在本地计算机上保存会话变量的位置以便以后用户可以打开多个浏览器来引导在不混合会话变量的情况下访问我们网站的不同分支。

提前致谢,

Jing




建议:


1)尝试为会话变量使用唯一的名称空间。 PHP没有
真的支持名称空间,但你可以伪造它。例如,将所有的会话变量放在一个数组中,一个名称为数组


_JING_SESS,而他/

也是如此,将他放入


_HISNAME_SESS。然后你得到

的值

Hi, you all,

I am a newbee for php and I need your help. One of my coworker and I
are both developing a webpage for our project using php. We have a
copy of the same files in different location on the server (in our own
accounts on the same machine). When I am testing both versions of our
program using the same browser (IE on Windows or Konqueror on Linux)
the session variables will mix up and only the latest selection or
options will be displayed. If I go back and forth using the "Previous"
and "Next" buttons on our pages not only the variables from my pages
will change to the variables from his page, but also my page will jump
to his page as well. I am wondering if there is a way to specify where
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

解决方案

On Wed, 17 Dec 2003 12:25:30 -0800, jing_li wrote:

Hi, you all, <snip>
I am wondering if there is a way to specify where 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



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


这篇关于如何区分多个会话?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆