Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #17725
| From | "Christoph M. Becker" <cmbecker69@arcor.de> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: PHP sessions |
| Date | 2018-05-06 14:11 +0200 |
| Organization | solani.org |
| Message-ID | <pcmre3$emj$1@solani.org> (permalink) |
| References | <pcmdpu$2ek$1@dont-email.me> <pcmmoc$b4p$1@solani.org> <pcmqnr$n17$1@dont-email.me> |
On 06.05.2018 at 13:59, madwomans Dad wrote:
> What the heck is the point of a session object that closes automatically
> at the end of a request? The whole point of a session is that it stays
> active for a particular sequence of requests or a users 'session' onĀ a
> particular web site.
The session is closed, but not destroyed. You simply have to start the
session again. A simplified example:
step1.php
<?php
session_start();
$_SESSION['foo'] = 'bar';
header('Location: step2.php');
?>
step2.php
<?php
session_start();
echo $_SESSION['foo'];
?>
If you don't want to call session_start() at the beginning of each
script, you can also set session.auto_start=1 in your php.ini. See
<http://www.php.net/manual/en/session.configuration.php#ini.session.auto-start>.
See also <http://www.php.net/manual/en/book.session.php>.
--
Christoph M. Becker
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
PHP sessions madwomans Dad <dsvirtual58@gmail.com> - 2018-05-06 09:19 +0100
Re: PHP sessions "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-05-06 12:51 +0200
Re: PHP sessions madwomans Dad <dsvirtual58@gmail.com> - 2018-05-06 12:59 +0100
Re: PHP sessions "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-05-06 14:11 +0200
Re: PHP sessions Gregor Kofler <usenet@gregorkofler.com> - 2018-05-06 14:13 +0200
Re: PHP sessions madwomans Dad <dsvirtual58@gmail.com> - 2018-05-06 14:08 +0100
Re: PHP sessions "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-05-06 15:22 +0200
Re: PHP sessions madwomans Dad <dsvirtual58@gmail.com> - 2018-05-06 16:01 +0100
Re: PHP sessions "Christoph M. Becker" <cmbecker69@arcor.de> - 2018-05-06 17:27 +0200
Re: PHP sessions madwomans Dad <dsvirtual58@gmail.com> - 2018-05-06 19:17 +0100
Re: PHP sessions "J.O. Aho" <user@example.net> - 2018-05-06 18:57 +0200
Re: PHP sessions Richard Damon <Richard@Damon-Family.org> - 2018-05-06 13:21 -0400
csiph-web