Reply to Re: session handling using classes n objects

Your name:

Reply:


Posted by no on 12/05/06 13:00

On 5 Dec 2006 03:54:10 -0800, "viz" <vijayjoshi4u@gmail.com> wrote:
>On Dec 5, 4:28 pm, n...@emails.thx wrote:
>> On 5 Dec 2006 02:53:42 -0800, "viz" <vijayjosh...@gmail.com> wrote:
>>
>> >well i am not using database;
>>
>> >and i am also not using session handling functions like
>> >session_register and session_start Directly.
>> >i have implemented them using a session class and i am setting and
>> >retrieving session variables by using object of the session class.
>> >the problem i am facing is that as long as i use the session class
>> >object in a single page it is fine but what should i do in order to
>> >make that object accessible in other pages so that i may check the
>> >authenticity of user, using functions on the same object.
>> >hop i m clear this time.This sounds like circular logic and I'm tempted to ask why you want to
>> complicate the use of sessions by making a class that you then have to
>> hold in a normal $_SESSION[] variable?
>>
>> To make data 'persist' between pages choose one of the following:
>> 1. hold it is a database (but you're not doing that)
>> 2. hold it in cookies (but this can be switched off by the user)
>> 3. hold it in sessions.
>>
>> For something as simple as holding a userid I'd just create a
>> $_SESSION['userid'] variable on successful login and refer to it later
>> in the code by name.
>>
>> I can understand creating classes for managing complex data structures
>> (eg. database records etc) but from what you have said so far I don't
>> think it warrants it in your case. :o)
>>
>> Chris R.
>
>
>Thanx Chris,
>that was what i wanted to know. i am new to PHP5 thats why i was
>searching 4 the most feasible way.
>I have one more query....if u dont mind.
>
>when i am running my application on Firefox and if i login then the
>same session is getting duplicated if i open another tab. Although if i
>run the program on Firefox and IE simultaneously then 2 distinct
>sessions are being created.
>Is it normal??? How can it be explained??
>Currently i m playing with a small application but soon i think i will
>have to make use of databases for user management. Can u give some
>insight into that also.

My understanding of sessions is that the lifetime of the session is
within the browser being run ... 2 browsers would have a session each
.... close the browser and open it again and you get another session
.... run 2 tabs in the same browser and they share the same session. (I
think)

Chris R.

[Back to original 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

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