会话维护 [英] Session maintenance

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

问题描述

我正在努力更好地了解会话的工作方式。


在网页的开头,我做了session_start()或者

session_register(...)。当用户进入下一页时,我知道页面

需要获取SSID。我知道我可以把它作为一个cookie,隐藏的字段等发送,

但是有什么其他方式可以发送它?例如,我知道第二页顶部的
session_registering变量可以正常工作。


如果用户访问任何纯html页面(扩展名为html),当他们回到我的php页面时,我怎么能得到

会话。如果没有页面上的php,

如何传播SSID?


提前感谢

--- Michael

I''m trying to get a better feel for exactly how sessions work.

At the beginning of a web page, I do either a session_start() or a
session_register(...). When the user goes to the next page, I know the page
needs to get the SSID. I know I can send it as a cookie, hidden field, etc,
but what other ways are available to send it? For example, I know that
session_registering variables at the top of the second page works.

If the user visits any pure html pages (extension html), how can I get the
session back when they come back to my php pages. Without php on the page,
how can I propagate the SSID?

thanks in advance
---Michael

推荐答案

Michael Satterwhite写道:
Michael Satterwhite wrote:
我正在努力更好地了解会话是如何工作的。

在网页的开头,我做了session_start()或
session_register(...)。当用户转到下一页时,我知道页面需要获得SSID的
。我知道我可以将它作为cookie发送,隐藏
字段等,但还有其他方法可以发送它吗?例如,我知道
第二页顶部的session_registering变量可以工作。

如果用户访问任何纯HTML页面(扩展名为html),我怎么能得到
当他们回到我的php页面时会回来。如果在
页面上没有php,我怎样才能传播SSID?
I''m trying to get a better feel for exactly how sessions work.

At the beginning of a web page, I do either a session_start() or a
session_register(...). When the user goes to the next page, I know the page needs to get the SSID. I know I can send it as a cookie, hidden field, etc, but what other ways are available to send it? For example, I know that session_registering variables at the top of the second page works.

If the user visits any pure html pages (extension html), how can I get the session back when they come back to my php pages. Without php on the page, how can I propagate the SSID?




恕我直言,没有办法在纯HTML页面中携带会话ID。

可能你可能需要强制PHP解析html页面(在Apache中通过

设置)。也许还想尝试trans sid设置。

session_register()已经过时了。请参考手册

< http://www.php.net/session>


-

<? php echo''只是另一个PHP圣徒''; ?>

电子邮件:rrjanbiah-at-Y!com博客: http ://rajeshanbiah.blogspot.com/



IMHO, there is no way to carry the session id in pure html pages.
Probably you may need to force the html pages to be parsed by PHP (by
settings in Apache). May also want to try trans sid setting.
session_register() is obsolete. Please refer manual
<http://www.php.net/session>

--
<?php echo ''Just another PHP saint''; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/


*** MichaelSatterwhiteescribió/写道(Sun,2005年2月13日15:32: 11 GMT):
*** Michael Satterwhite escribió/wrote (Sun, 13 Feb 2005 15:32:11 GMT):
如果用户访问任何纯HTML页面(扩展名为html),当我们回到我的php页面时如何才能恢复
会话。
If the user visits any pure html pages (extension html), how can I get the
session back when they come back to my php pages.




让PHP使用默认解决方案来处理它:cookies。

-

- +álvaroG。Vicario - 西班牙布尔戈斯

+ - http://www.demogracia.com (la web de humor barnizada para la intemperie)

++ Manda tus dudas al grupo,no amibuzón

- +将你的问题发送给小组,而不是到我的邮箱

-



Just let PHP take care of it with the default solution: cookies.
--
-+ álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox
--


Michael Satterwhite写道:
Michael Satterwhite wrote:
at t他开始一个网页,我做了一个session_start()或一个
session_register(...)。
At the beginning of a web page, I do either a session_start() or a
session_register(...).




你不想要使用session_register()。使用



You don''t want to use session_register(). Use the


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

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