#1
  1. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    hi,
    can you tell me ,how to set session variables and how to retrive it in subsequent pages?

    i want to set username and password session variables from login page for tracking the user in my site.


    Thanks in advance



    ------------------
    shiju
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    6
    Rep Power
    0
    There are two ways that you could do it. One is store the session variable into a table, and then on each page at the very top, have a function that checks to see if the session is valid.
    Another way to do it is come up w/ ur own encryption scheme and then check if the encrypted session is valid.
    You'll have to pass the sessionID and whatever else you are going to check to each page. You can do this by passing the information in the URL
  4. #3
  5. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Hi,
    Thank you for helping me.

    Can you give me an example of session tracking?
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Gorakhpur,U.P.,India
    Posts
    24
    Rep Power
    0
    I have implemented session tracking in an application of mine which i am detailing below. hope u find it useful...

    i am using a combination of the username and the ip address of the user to generate a session variable from page to page. this string is encrypted using md5

    this works fine without any problems...
  8. #5
  9. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Hi amodi,

    i am not clear your explanation.can you show me a couple of lines of code.




    [This message has been edited by Shiju Rajan (edited April 01, 2000).]
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    6
    Rep Power
    0
    You can check out an article that www.phpbuild.com has on session management. It'll probably have some code examples as well.

    [This message has been edited by ecchu79 (edited April 01, 2000).]

    [This message has been edited by ecchu79 (edited April 01, 2000).]

Similar Threads

  1. Can user A read user B's session?
    By Stupid Khor in forum PHP Development
    Replies: 9
    Last Post: May 11th, 2004, 06:19 AM
  2. Assigning multiple session id
    By Stupid Khor in forum PHP Development
    Replies: 4
    Last Post: February 2nd, 2004, 08:12 AM
  3. losing session variables
    By shawazi in forum PHP Development
    Replies: 1
    Last Post: January 27th, 2004, 01:02 PM
  4. How to get multiple sessions for one user working?
    By jkoerber in forum PHP Development
    Replies: 1
    Last Post: January 16th, 2004, 02:23 PM
  5. function to set session variables
    By clearbar in forum PHP Development
    Replies: 1
    Last Post: January 13th, 2004, 02:47 PM

IMN logo majestic logo threadwatch logo seochat tools logo