丢失会话变量 [英] Losing session variables

查看:54
本文介绍了丢失会话变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含表单的页面。页面提交给自己,如果

数据验证,则将发布的变量存储到数据库中,并将
存储到会话中。然后我使用标题重定向到另一个页面,其中
从会话数组中获取变量并显示它们。


所有在Linux测试服务器上工作正常。然而,生产服务器

是Windoze运行PHP 5.注册全局关闭我间歇性地丢失了
变量。来自会话数组


它不是一个寄存器全局问题 - 有时它们有时会在那里没有b $ b。我能看到的另一个区别是session.gc.divisor

设置为1000


任何人都会遇到这样的事情吗?

-

问候,


Geoff Berrow

I have a page containing a form. The page submits to itself and if the
data validates, stores the posted variables into a database and also
into a session. I then use header to redirect to another page which
fetches the variables from the session array and displays them.

All works fine on the Linux test server. However the production server
is Windoze running PHP 5. reg globals off I am intermittently losing
variables. from the session array

It''s not a register globals issue - sometimes they are there sometimes
not. The only other difference I can see is the session.gc.divisor
which is set to 1000

Anyone come across anything like this?
--
Regards,

Geoff Berrow

推荐答案

重定向之前是否会话写入关闭?这可能有所帮助:

http://www.php.net/manual/en/functio...rite-close.php


汤姆


Geoff Berrow写道:
Are you session-write-closing before redirect? This may help:

http://www.php.net/manual/en/functio...rite-close.php

Tom

Geoff Berrow wrote:
我有一个包含表格的页面。页面提交给自己,如果
数据有效,则将发布的变量存储到数据库中,并将其存储到会话中。然后我使用header重定向到另一个页面,它从会话数组中取出变量并显示它们。

所有在Linux测试服务器上运行正常。然而生产服务器是Windoze运行PHP 5.注册全局关闭我间歇性地丢失变量。来自会话数组

它不是一个寄存器全局问题 - 有时它们有时候不在那里。我能看到的唯一的另一个区别是session.gc.divisor
设置为1000
任何人都会遇到这样的事情吗?
-
问候,

Geoff Berrow
I have a page containing a form. The page submits to itself and if the
data validates, stores the posted variables into a database and also
into a session. I then use header to redirect to another page which
fetches the variables from the session array and displays them.

All works fine on the Linux test server. However the production server
is Windoze running PHP 5. reg globals off I am intermittently losing
variables. from the session array

It''s not a register globals issue - sometimes they are there sometimes
not. The only other difference I can see is the session.gc.divisor
which is set to 1000

Anyone come across anything like this?
--
Regards,

Geoff Berrow






消息ID:< 11 ********** ***********@h76g2000cwa.googlegroups。 COM>来自

Tom包含以下内容:
Message-ID: <11*********************@h76g2000cwa.googlegroups. com> from
Tom contained the following:
重定向之前是否会话写入关闭?这可能有所帮助:

http://www.php.net/manual/en/functio...rite-close.php
Are you session-write-closing before redirect? This may help:

http://www.php.net/manual/en/functio...rite-close.php




谢谢汤姆,我实际上现在已经解决了这个问题,但是我需要知道是什么造成了它,这可能会解释它。


-

Geoff Berrow(把猫放到电子邮件中)

它只是Usenet,没有人死。

我的意见,而不是委员会的,我的。

简单的RFD http://www.ckdog.co .uk / rfdmaker /


这篇关于丢失会话变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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