Re: sessions variables and meta refresh
| From: | Clive Hughes | Date: | Wed, 11 Oct 2000 12:09:12 +0000 |
| Subject: | Re: sessions variables and meta refresh | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-19580@lists.php.net to get a copy of this message | ||
Henti,
You *can* maintain session data with redirection; just remember to pass the
session ID thru.
For example,
<?php
session_register(...);
session_register(...);
header("location: nextpage.php?" . SID); // SID = constant
defining session ID
?>
I am not using cookies and this works.
BTW: Regarding client-side redirection, I seem to recall that the W3C HTML
spec states that auto page forwarding should be done by server-side
redirects
(http://www.w3.org/TR/html4/global.html). Of course, this is only a
recommendation ;-)
If you must use client-side redirect the principle should still be the same
i.e.
<?php
session_register(...);
session_register(...);
$URL = "nextpage.php" . SID;
?>
<meta http-equiv="Refresh" content="0; URL=<?php echo $URL; ?>">
(Not tested, I prefer server-side redirect)
--Clive
----- Original Message -----
From: <hentis@twilyt.com>
To: "PHP list" <php-general@lists.php.net>
Sent: Wednesday, October 11, 2000 10:53 AM
Subject: Re: [PHP] sessions variables and meta refresh
> I tried replacing meta with header(location) and still the same things
happens ..
> I losse the values of sessions once it redirects ...
>
> this is strange ..
>
> I must say I'm not sending cookies around .. but i have cookies enabled ..
>
> Henti
>
> On Wed, Oct 11, 2000 at 11:34:02AM +0200, hentis@twilyt.com wrote:
> > hi all
> >
> > I'm using <meta http-equiv=\"Refresh\" content=\"0;
> > URL=$URL\"> to
refresh to a new page after authentication
> > I register the variables fine .. and I can access them fine .. but once
the page has redirected the session vars are still registered
> > but does no longer contain the values it had previosly ..
> >
> > Does anybody know why this could happen ?
> >
> > henti
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>