SV: [PHP] Send a cookie with a file_get_contents( ) request?
| From: | Anders Norrbring | Date: | Sat, 09 Aug 2008 20:47:17 +0000 |
| Subject: | SV: [PHP] Send a cookie with a file_get_contents( ) request? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277942@lists.php.net to get a copy of this message | ||
> Anders Norrbring wrote:
>
> > I have a web site where I use cookies to store logins, and also
> > session cookies for users logged in.
> > Is there a way for me to use file_get_contents() to pull content
> which
> > are "behind" the login?
> > In other words, I want to use my own log-in cookie and somehow send
> it
> > with the file_get_contents request to get the content.
> > Can I somehow do this? Or are there other ways?
>
> I think you can do that by using a stream context.
>
> http://php.net/manual/en/function.stream-context-create.php
>
>
> /Per Jessen, Zürich
Thanks Per,
I think so too, I glanced it, but unfortunately I have no idea whatsoever about *how* to do it...
So, if anyone have suggestions, or concrete examples, please do share!
Anders.