You are here: Re: [PHP] Re: multiple sessions on same server/domain « PHP « IT news, forums, messages
Re: [PHP] Re: multiple sessions on same server/domain

Posted by Marek Kilimajer on 01/19/05 00:26

Jason Barnett wrote:
> Valter Toffolo wrote:
>
>> ok i have one server with a single domain, each user have it's home
>> with a public_html so i get mydomain.com/~user1/ and
>> mydomain.com/~user2/ and so on. but each user might like to use
>> sessions so how can i make it work so that sessions would have each
>> one it's own variables and all...??
>>
>> thanks, valter.
>
>
> What is the problem? If you have session support set in PHP then each
> user should be able to session_start etc. The default session handler
> that comes with PHP will allow each user to have their own session
> variables (technically they're indices in the $_SESSION superglobal array).
>
> Please check the PHP manual to see how to set up session support if
> that's what you're confused about.
>

The problem is with cookies being common for all user directories.

Each user should use session_set_cookie_params() to set the cookie path
to its own directory. And use of session_regenerate_id() is a must, else
user1 can set the cookie path to /~user2/ with lifetime till 2038 and...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация