SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2002
    Location
    Frankfurt
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Objects in Sessions Variables ?

    Hi,
    i m having problems storing objects in Sessions.
    what i do is:
    a little snippet ...

    script1.php
    PHP Code:
     include ('./inc/classes.php');
     
    session_start();   
     
    $usr = new User;   // User is the class .... 
     
    session_register("usr");
     
    usr->logged 1
    do i then still have to register the variables in the User object?

    I know that i have to include the definition of User on every page i want to use the session stored user, but somehow this does not work.
    so, on the next page i first again include the Class definition, and then start the Session (again)

    script2.php
    PHP Code:
     include ('./inc/classes.php');
     
    session_start();
     
    session_register("usr");
     echo 
    $usr->logged 
    But this somehow jut ist not working. What am i doing wrong? Anyone an idea, or sees my fault ??

    thx ...
    Last edited by oversize; Apr 5, 2002 at 03:06.
    ? is it over ?
    =?=?=?=?=?=?=?=

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Moved to a more appropriate forum

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    SitePoint Member
    Join Date
    Apr 2002
    Location
    Frankfurt
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    please,
    is there noone who had done this before? storing Objects in sessions?
    Is there a better way?
    I want to write a user Authentication, and thought this would be a nice way, not to have a MySQL Querrie on everypage (cause got all the INformation in this Session Specific Object)

    please, i appreciate any help, or suggestions or ideas, or other ways.

    i need this User Auth System quick....
    ? is it over ?
    =?=?=?=?=?=?=?=


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •