FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Session Handling for multiple languages, permission denied
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Session Handling for multiple languages, permission denied [message #170924 is a reply to message #170917] Wed, 08 December 2010 20:40 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 12/8/2010 5:42 AM, jwcarlton wrote:
> On Dec 8, 3:01 am, Erwin Moller
> <Since_humans_read_this_I_am_spammed_too_m...@spamyourself.com> wrote:
>> On 12/8/2010 8:26 AM, jwcarlton wrote:
>>
>>> I can set and read $_SESSION in PHP, no problem. But the file is being
>>> stored on the server at /tmp/, and it's permission is set at 0600
>>> (read and write by owner only).
>>
>>> If I want to access the session in other languages (like Perl),
>>> permission is denied. How do I set PHP to save them with a different
>>> read/write permission?
>>
>> Hi,
>>
>> As you mentioned, it is all about filepermissions.
>> So you must first figure out the users that are acting in name of the
>> programs. Or differently formulated, figure out as *which* user PHP
>> runs, and also for Perl.
>>
>> It is possible they both run under Apache as www-data (Or 'apache', or
>> 'nobody': whatever you/your distro choosed when you installed apache.)
>>
>> If they are both the same user, you can read the sessionfiles.
>> If not, you have a few options:
>> 1) Make them the same user.
>> 2) Change the sessionstorage directory for PHP, and make sure you give
>> it such permissions both users can access it.
>>
>> I would advise against changing the permissions for /tmp.
>>
>> Hope this helps.
>>
>> Regards,
>> Erwin Moller
>>
>> --
>> "There are two ways of constructing a software design: One way is to
>> make it so simple that there are obviously no deficiencies, and the
>> other way is to make it so complicated that there are no obvious
>> deficiencies. The first method is far more difficult."
>> -- C.A.R. Hoare
>
> Thanks, Erwin. Can you suggest how I would tell which user PHP and
> Perl run as? I suspect that you're correct, and that they are
> different.
>
> If I change the session storage directory, is there a risk of it
> running slower?

It won't run slower, as long as you're not on a slower disk. However,
the advantage of /tmp is it is cleaned up by the system in case of a
crash/reboot. Other directories may not be.

Of course, it's not a problem if the system never reboots. But most
(even linux) need to reboot occasionally, i.e. after applying
maintenance or to add/replace hardware.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: What could be causing this "Invalid callback" warning?
Next Topic: Best PHP Groupware Tools Script Sharing
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 12:00:34 GMT 2024

Total time taken to generate the page: 0.06146 seconds