Re: PHP Sessions
| From: | Aziz Saleh | Date: | Thu, 27 Jan 2022 21:09:51 +0000 |
| Subject: | Re: PHP Sessions | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-327894@lists.php.net to get a copy of this message | ||
On Thu, Jan 27, 2022 at 4:06 PM <paulf@quillandmouse.com> wrote:
> On Thu, 27 Jan 2022 11:40:52 -0500
> Aziz Saleh <azizsaleh@gmail.com> wrote:
>
> > You can run an example test via browser to see it in action:
> > -----------------------------
> >
> > $name = isset($_GET['name']) ? $_GET['name'] : 'PHPSESSID';
> > echo 'Name: ' . $name . '<br/>';
> > session_name($name);
> > session_start();
> >
> > echo 'Cookie/Session name: ';
> > echo session_name();
> > echo '<br />';
> >
> > echo "Value: " . session_id();
> >
> > --------------------------
> >
> > Change ?name=SESSION_Name
> >
>
> I've been studying the cookies on the server and in Firefox's local
> cache of cookies, and reading up on the cookie "process".
>
> Follow up question: When your browser requests a page from the server,
> does it send *all* the unexpired cookies where that server is the host,
> regardless of the actual page being requested?
>
> Paul
>
>
> --
> Paul M. Foster
> http://noferblatz.com
> http://quillandmouse.com
Yep. Cookies are based on domain level (a sub domain is also its own
domain). It sends all cookies regardless of which page in that domain
created them.