每次更改会话ID转到新页面或重新加载。 [英] Session ID changed everytime go to new page or reload.

查看:106
本文介绍了每次更改会话ID转到新页面或重新加载。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是这个小组的新成员。


我在我的内联网服务器上添加了新的虚拟主机。 httpd.conf上新的虚拟

主机配置与旧的相似。

在新的虚拟主机上,会话ID似乎每次都改变了

与服务器的交互(新页面或重新加载)。

旧的很好,会话ID保持相同的字符串。

两者都在同一台服务器上。

我使用Apache 2.2.3(Win32)和PHP 5.2.0。


使用以下代码进行测试:

session_start( );

echo session_id();

PHP配置:

session.save_handler = files

; session。 save_path =" / tmp"

session.use_cookies = 1

; session.use_only_cookies = 1

session.name = PHPSESSID
session.auto_start = 0

session.cookie_lifetime = 0

session.cookie_path = /

session.cookie_domain =

session.serialize_handler = php

session.gc_probability = 1

session.gc_divisor = 1000

session.g c_maxlifetime = 1440

session.bug_compat_42 = 0

session.bug_compat_warn = 1

session.referer_check =

session .entropy_length = 0

session.entropy_file =

; session.entropy_length = 16

; session.entropy_file = / dev / urandom

session.cache_limiter = nocache

session.cache_expire = 180

session.use_trans_sid = 0

session.hash_function = 0

session.hash_bits_per_character = 5

如何修复新主机以保持其会话ID不变?

对不起英语不好。

TIA

Hi, I''m new member of this group.

I had added new virtual host at my intranet server. The new virtual
host configuration on httpd.conf is similar with the old one.
At the new virtual host, the session id seems changed every
interaction to server (new page or reload).
The old one is fine, the session id keeps at the same string.
Both are at the same server.
I use Apache 2.2.3 (Win32) with PHP 5.2.0.

Tested using code below:
session_start();
echo session_id();
PHP Configuration :
session.save_handler = files
;session.save_path = "/tmp"
session.use_cookies = 1
;session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = 0
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
;session.entropy_length = 16
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5

How to fix the new host to keep its session id unchanged?
Sorry for the bad english.
TIA

推荐答案

Bocah Sableng写道:
Bocah Sableng wrote:

我是这个小组的新成员。


我在我的内联网服务器上添加了新的虚拟主机。 httpd.conf上新的虚拟

主机配置与旧的相似。

在新的虚拟主机上,会话ID似乎每次都改变了

与服务器的交互(新页面或重新加载)。

旧的很好,会话ID保持相同的字符串。

两者都在同一台服务器上。

我使用Apache 2.2.3(Win32)和PHP 5.2.0。


使用以下代码进行测试:

session_start( );

echo session_id();


PHP配置:

session.save_handler = files

; session.save_path =" / tmp"

session.use_cookies = 1

; session.use_only_cookies = 1

session.name = PHPSESSID

session.auto_start = 0

session.cookie_lifetime = 0

session.cookie_path = /

session。 cookie_domain =

session.serialize_handler = php

session.gc_probability = 1

session.gc_divisor = 1000

sess ion.gc_maxlifetime = 1440

session.bug_compat_42 = 0

session.bug_compat_warn = 1

session.referer_check =

session.entropy_length = 0

session.entropy_file =

; session.entropy_length = 16

; session.entropy_file = / dev / urandom

session.cache_limiter = nocache

session.cache_expire = 180

session.use_trans_sid = 0

session.hash_function = 0

session.hash_bits_per_character = 5

如何修复新主机以保持会话ID不变?

对不起糟糕的英语。

TIA
Hi, I''m new member of this group.

I had added new virtual host at my intranet server. The new virtual
host configuration on httpd.conf is similar with the old one.
At the new virtual host, the session id seems changed every
interaction to server (new page or reload).
The old one is fine, the session id keeps at the same string.
Both are at the same server.
I use Apache 2.2.3 (Win32) with PHP 5.2.0.

Tested using code below:
session_start();
echo session_id();
PHP Configuration :
session.save_handler = files
;session.save_path = "/tmp"
session.use_cookies = 1
;session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = 0
session.bug_compat_warn = 1
session.referer_check =
session.entropy_length = 0
session.entropy_file =
;session.entropy_length = 16
;session.entropy_file = /dev/urandom
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5

How to fix the new host to keep its session id unchanged?
Sorry for the bad english.
TIA



您的Apache错误日志中有什么(或者您的PHP错误在哪里)

被记录)?


-

==================

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================

What''s in your Apache error log (or where ever you have your PHP errors
being logged)?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


4月9日下午7:52,Jerry Stuckle< jstuck ... @ attglobal.netwrote:
On Apr 9, 7:52 pm, Jerry Stuckle <jstuck...@attglobal.netwrote:

>

您的Apache错误日志中有什么(或者您的PHP错误在哪里?

被记录)?
>
What''s in your Apache error log (or where ever you have your PHP errors
being logged)?



感谢您的回复。


我的Apache错误日志中没有任何行显示任何错误,并且未记录

PHP错误。


之前发布的php代码似乎正常执行。这是我的Apache访问日志中的一个剪辑

(并重复几次):

192.168.1.90 - - [09 / Apr / 2007:11:54:17 + [0000]GET /session_id.php

HTTP / 1.1 200 330


我不知道会话ID生成的机制。 ''当我移动

顶部的新虚拟主机并使用其本地IP

地址(192.168.1.90)访问时,问题就消失了。但是当使用命名的vhost访问

时(即使顶部有新的vhost配置),

问题仍然存在。

我应该发布vhost配置? (这个组是php新闻组)


和另一个信息:

我使用''register_globals = on''以及''register_long_arrays = on''

向后兼容我的古代脚本。我知道这很糟糕

的习惯,但我使用的应用程序和服务器都只用于内网应用

而我没有太多时间来解决所有问题。


谢谢。

Thanks for you response.

There''s no line indicating any error on my Apache error log, and the
PHP errors are not logged.

The php code I posted before seems normally executed. Here is a snip
from my Apache access log (and repeated several times) :
192.168.1.90 - - [09/Apr/2007:11:54:17 +0700] "GET /session_id.php
HTTP/1.1" 200 330

I don''t know the mechanisms of session id generation. ''Cos when I move
the new virtual host at the top and accessed using its local IP
address (192.168.1.90), the problem disappears. But when accessed
using named vhost (even if the new vhost config at the top), the
problem still remain.
Should I post the vhost config? (This group is php newsgroup)

And another info:
I use ''register_globals=on'' and also ''register_long_arrays=on'' for
backward compatibility with my ancient scripts. I know it''s a bad
habit, but I use the application and the server both for intranet app
only and I don''t have much time to fix all.

Thanks.


4月9日下午7:54,Bocah Sableng < cahsabl ... @ gmail.comwrote:


[...]
On Apr 9, 7:54 pm, "Bocah Sableng" <cahsabl...@gmail.comwrote:

[...]

另一个信息:
And another info:



我在 http://bugs.php.net/bug.php?id=16263

但我不认为这是同样的问题。

I found Bug #16263 on http://bugs.php.net/bug.php?id=16263.
But I don''t think it''s the same problem.


这篇关于每次更改会话ID转到新页面或重新加载。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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