Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    confused about custom session handling

    hi
    i think im confused about how to use session variables stored in a database....and would like some help
    im not displaying code because i think im not getting the point of the session handler

    after coding a website, on uploading it, i found that the host did not support file stored session variables
    so i found out about custom session handling at zend

    i tried using the code supplied while accessing another table that checks password and username
    the session handling code worked on its own
    the password and username code worked on its own
    but on the same page, the session handling code doesnt work with the password and username checking code
    i dont want the session created if the user doesnt enter the correct data so i need to check password and username in another table first (and extract some data to be used in the session from the table containing the password and username)
    it could have been a coding problem but i didnt want to post anything until i got some feedback

    also im not sure how to use variables stored in the database by the session handler
    for example if i wanted a variable that held the access level of users that allows them access (e.g admin, member) to particular pages and i wanted to create a session variable called access_Level, how do i access this variable?
    if the variable is file based its just $HTTP_SESSION_VARS['access_Level']
    if the session variable is stored in a database how do i access the variable without having to open the database each time the user moves from page to page? that doesnt seem to make sense to me - thats why i think im confused about how to use the session data in the database

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It's hard to help you if you don't have a real question or problem or some piece of code we can look at.

    If you store 'sessionvariables' in a db, then you need to make a connection to that db on each page where you need that variables data. But i don't quite see
    why you would call it a sessionvariable then since it doesn't have anything to do with php's sessionvariables.
    Whats the reason why you don't use sessionvariable? What do you mean by "file stored session variables"?

    By the way, the correct way to call a sessionvariable is $_SESSION['variablename']
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #3
    New Coder
    Join Date
    Apr 2004
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the coding i had before stored the variables in a temporary file (this is done automically by php)
    - but this is not allowed by the host who has load balancing
    so i have to use a custom session handler
    http://www.zend.com/zend/spotlight/c...lery-wade8.php


    whats the difference between $HTTP_SESSION_VARS and $_SESSION?


  •  

    Posting Permissions

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