You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by yokota <yo...@passlogy.com> on 2012/03/02 02:01:56 UTC

How to read PHP session in module

Hello,

I want to read PHP session in my private module.
PHP session id is in PHPSESSID cookie but
I want to read the contents of PHP session in my module.

Please let me know if you have any suggestions.
Thank you in advance.

Yokota Sakuko

Re: How to read PHP session in module

Posted by Joe Lewis <jl...@silverhawk.net>.
Php hooks into that, too, and can do basic auth. Look into that instead. It
would be easier to implement, less complex. And just as functional.

Joe
On Mar 1, 2012 10:48 PM, "yokota" <yo...@passlogy.com> wrote:

> Thanks for the response, Joe.
>
> My private module is for authentication.
> I will be happy if I can read PHP session
> before user authentication.
>
> If a loginOK flag of an applicationA is
> in PHP session, the user pass throug my module.
> If not, the user need to be authenticated.
>
> But probably, it will be difficult as you say.
>
>
>
> Thank you,
> Sakuko
>
>
> (2012/03/02 10:27), Joe Lewis wrote:
>
>> Use a php module? Seriously, you'll have to find out where the session
>> files are kept, and read the appropriate one. Parsing may be more
>> primitive, because you aren't using php. It's the cost of reinventing the
>> wheel.
>>
>> Joe
>> On Mar 1, 2012 6:02 PM, "yokota"<yo...@passlogy.com>  wrote:
>>
>>  Hello,
>>>
>>> I want to read PHP session in my private module.
>>> PHP session id is in PHPSESSID cookie but
>>> I want to read the contents of PHP session in my module.
>>>
>>> Please let me know if you have any suggestions.
>>> Thank you in advance.
>>>
>>> Yokota Sakuko
>>>
>>>
>

Re: How to read PHP session in module

Posted by yokota <yo...@passlogy.com>.
Thank you for your good information.
I am sorry my reply becomes slow.

my private module is an authentication module
that uses a kind of OTP.
So, if possible, I hesitate to use Basic authentication.

I will struggle a little more.

I learned a lot  from you. Thank you.


Best regards,
Sakuko


(2012/03/05 13:26), Joe Lewis wrote:
> If you search Google for "php basic auth", you should get some results.
> Take a look, there should even be some tutorials.
> On Mar 4, 2012 7:54 PM, "yokota"<yo...@passlogy.com>  wrote:
>
>> Thank you for your resonses, Joe and Ray.
>>
>> Joe,
>>> Php hooks into that, too, and can do basic auth.
>> Could you tell me more in detail?
>>
>> Ray,
>> I didn't know about "apache_note". Thank you for good information.
>> I can control PHP application under /app1/. So I can use "apache_note"
>> when a user access /app1/ .
>> But when a user access /app2/, I can not control under /app2/ and
>> exactly at this time, I need to know whether a user is already logged in
>> /app1/.
>>
>>
>> Best regards,
>> Sakuko
>>
>>
>> (2012/03/03 3:43), Ray Morris wrote:
>>
>>> Do you control the PHP application? "notes" are a mechanism for
>>> modules to share data, and PHP can set a note which can then
>>> be read by the new Apache module.
>>>
>>> http://php.net/manual/en/**function.apache-note.php<http://php.net/manual/en/function.apache-note.php>
>>>
>>


Re: How to read PHP session in module

Posted by Joe Lewis <jl...@silverhawk.net>.
If you search Google for "php basic auth", you should get some results.
Take a look, there should even be some tutorials.
On Mar 4, 2012 7:54 PM, "yokota" <yo...@passlogy.com> wrote:

> Thank you for your resonses, Joe and Ray.
>
> Joe,
> >Php hooks into that, too, and can do basic auth.
> Could you tell me more in detail?
>
> Ray,
> I didn't know about "apache_note". Thank you for good information.
> I can control PHP application under /app1/. So I can use "apache_note"
> when a user access /app1/ .
> But when a user access /app2/, I can not control under /app2/ and
> exactly at this time, I need to know whether a user is already logged in
> /app1/.
>
>
> Best regards,
> Sakuko
>
>
> (2012/03/03 3:43), Ray Morris wrote:
>
>> Do you control the PHP application? "notes" are a mechanism for
>> modules to share data, and PHP can set a note which can then
>> be read by the new Apache module.
>>
>> http://php.net/manual/en/**function.apache-note.php<http://php.net/manual/en/function.apache-note.php>
>>
>
>

Re: How to read PHP session in module

Posted by yokota <yo...@passlogy.com>.
Thank you for your resonses, Joe and Ray.

Joe,
 >Php hooks into that, too, and can do basic auth.
Could you tell me more in detail?

Ray,
I didn't know about "apache_note". Thank you for good information.
I can control PHP application under /app1/. So I can use "apache_note"
when a user access /app1/ .
But when a user access /app2/, I can not control under /app2/ and
exactly at this time, I need to know whether a user is already logged in 
/app1/.


Best regards,
Sakuko


(2012/03/03 3:43), Ray Morris wrote:
> Do you control the PHP application? "notes" are a mechanism for
> modules to share data, and PHP can set a note which can then
> be read by the new Apache module.
>
> http://php.net/manual/en/function.apache-note.php


Re: How to read PHP session in module

Posted by yokota <yo...@passlogy.com>.
Thanks for the response, Joe.

My private module is for authentication.
I will be happy if I can read PHP session
before user authentication.

If a loginOK flag of an applicationA is
in PHP session, the user pass throug my module.
If not, the user need to be authenticated.

But probably, it will be difficult as you say.



Thank you,
Sakuko


(2012/03/02 10:27), Joe Lewis wrote:
> Use a php module? Seriously, you'll have to find out where the session
> files are kept, and read the appropriate one. Parsing may be more
> primitive, because you aren't using php. It's the cost of reinventing the
> wheel.
>
> Joe
> On Mar 1, 2012 6:02 PM, "yokota"<yo...@passlogy.com>  wrote:
>
>> Hello,
>>
>> I want to read PHP session in my private module.
>> PHP session id is in PHPSESSID cookie but
>> I want to read the contents of PHP session in my module.
>>
>> Please let me know if you have any suggestions.
>> Thank you in advance.
>>
>> Yokota Sakuko
>>


Re: How to read PHP session in module

Posted by Joe Lewis <jl...@silverhawk.net>.
Use a php module? Seriously, you'll have to find out where the session
files are kept, and read the appropriate one. Parsing may be more
primitive, because you aren't using php. It's the cost of reinventing the
wheel.

Joe
On Mar 1, 2012 6:02 PM, "yokota" <yo...@passlogy.com> wrote:

> Hello,
>
> I want to read PHP session in my private module.
> PHP session id is in PHPSESSID cookie but
> I want to read the contents of PHP session in my module.
>
> Please let me know if you have any suggestions.
> Thank you in advance.
>
> Yokota Sakuko
>