本文介绍了Session_Start()不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我是PHP的新手,我正在尝试创建一个登录表单。一旦用户登录

,他就不必再次登录了。问题是我得到每个页面之间的新会话ID,所以它不会识别用户。

我用过Session_Start()我以为是为了维持会话

页面之间的变量,但它不起作用。


任何想法或常见问题解答'?br />

谢谢

Chris

解决方案



在每个页面之间获得


会话



您是否在每个页面上使用session_start?您确定您的系统是否已正确配置以存储会话?您是否在会话中注册了
变量,因此可以在下一步中找到它们。页面?

- Virgil





我不知道如何检查?



我在每个页面上都有session_start()这就是你的意思。




不,你需要明确定义你想要存储在会议中的变量。
会话。 />

例如:


<?php


session_start();


Hi

I''m new to PHP and I''m trying to create a Login Form. Once the user has
logged in then he shouldn''t have to log in again. The trouble is I''m getting
a new session ID between every page and so it doesn''t recognise the user.
I''ve used Session_Start() which I thought was meant to maintain the session
variables between pages but it doesn''t do work.

Any ideas or FAQ''s?

Thanks
Chris

解决方案



Are you using session_start on every page? Are you certain your system is
properly configured to store the sessions? Are you registering your
variables with the session so they are available on the "next" page?

- Virgil



getting


session



Are you using session_start on every page? Are you certain your system is
properly configured to store the sessions? Are you registering your
variables with the session so they are available on the "next" page?

- Virgil





I dunno how do I check?



I''ve got session_start() on each page if that''s what you mean.



No, you need to explicity define the variables you want stored in
the session.

For example:

<?php

session_start();


这篇关于Session_Start()不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 11:30