...

View Full Version : confused about custom session handling



pixelwraith
05-12-2004, 03:16 PM
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

raf
05-12-2004, 03:41 PM
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']

pixelwraith
05-13-2004, 02:35 AM
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/code-gallery-wade8.php


whats the difference between $HTTP_SESSION_VARS and $_SESSION?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum