English 中文(简体)
正在设立网站。 • 自动启动1项被视为不正确的做法?
原标题:Is setting php.ini s session.auto_start to 1 considered bad practice?
  • 时间:2011-11-24 12:30:20
  •  标签:
  • session
  • php

我正在与Sphp.ini会议举行。 从一开始,就试图将其定为1。 我正在建造的这个网站,需要每页任何途径的会期管理,而服务器只包含一个网站。 难道这被认为是不好的做法(例如,全球化——我有爱的BTW!) - php.net没有说多少话。

最佳回答
  • 海事组织依赖php.ini 如果部署你的 app子的人不控制<代码>php.ini(如共用主机),环境就会trick。 即便是<代码>php.ini。 理解由于<代码>php.ini而出现的问题可能难以理解(如果混为一谈,可能必须写上允许检查的文字)。

  • 作为一种替代办法,您可以创建一种独特的“控制器”文字(例如/index.php),根据发给它的各种参数(例如yoursite.com/index.php?page=12)使用不同的页面并产生不同的页面。 或甚至更好的<代码>yoursite.com/page/12 with routing & URL rebecca. 在index.php文档中,将session_start()一整页。

问题回答

纳哈,为什么? 原则上,它与<代码>session_start(>);作为每一页的第二行。

坦率地说,我认为,英国移民发展署将自动地执政。 与其他人一样,这同在你的所有网页上开一会一样。

Imagine all people that enters the main page of your website. A session will be created even before they tried to login or anything else. All spam-bots, all search engine bots etc will all create a session when entering your page. This is usually a bad thing as it will create TONS of files on your server (if session is file-based) or fill your ram cache (if session is memcache based).

只有在你实际召集了一届会议时,才算出会议时间。 你们只能创建一种“会期”或简单的职能,如届会——目标(目标)和届会——产出(产出)等,这届会议将为你们开学。 然后直接使用这些款项,而不是美元。

我要说的是,答案是“是,是坏的”。

[争端: 我于1997年开始建立网页——当时,你把一切放在手上,因此,我制定了自己的做事方式。]

在我国,我有一位我的Session汉德勒,他向各位神职。 它把包含所有必要的内乱指挥的尼尼尼尼共(NINI)档案拉开。 我注意到,我不是唯一这样做的人。 如果您自始至终(在守则执行之前就举行),那么一些框架也存在问题。

The first line of executable code in my PHP scripts is a require of MySessionHandler.php, which starts off by checking the values of auto-start and use_strict_mode, optionally dying with an error if they are not set properly.

由于你能够以只读的方式开始开会,以取得更好的业绩并避免会议记录锁定,我更愿意手工地开始会议。





相关问题
why the session in iis automatically log out?

I used iis6, and when i called a function Directory.delete(), the all the session relate this website will be logged out. and i debugged the website, i found no exception. any one have ideas on this ? ...

Check session from a view in CodeIgniter

What is the best way to check session from a view in CodeIgniter, it shows no way in their user guide, otherwise I will have to make two views on everything, which is kinda weird...still a newbie to ...

Can I get the size of a Session object in bytes in c#?

Is it possible to get the size(in bytes) of a Session object after storing something such as a datatable inside it? I want to get the size of a particular Session object, such as Session["table1"], ...

提供严格分类的出席会议物体

提供严格分类的与会机会的最佳方式是什么? 我正计划转而选择矩阵,这正在促使汇编者抱怨我的幻觉方案拟订方法......

PHP Session is not destroying after user logout

I m trying to create an authentication mechanism for my PHP Application and I m having difficulty destroying the session. I ve tried unsetting the authentication token which was previously set within ...

热门标签