sessions and postgres

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
soshea
Forum Commoner
Posts: 31
Joined: Tue Nov 12, 2002 11:22 pm
Location: Idaho
Contact:

sessions and postgres

Post by soshea »

well since cookies are to quirky(will work some of the time, but relies to much on the user). can i get any suggestions from the group on how to make a session management tool with postgres.
basically the user will login to the page (utilizing https) and from that form we validate off of the postgres user table the person is a member and set the sessions.
would i set all sessions the ie:
userid
userlevel
userteam
from the data in the table? or do i create a table and enter user data for the sesison when they logon and delete the data when they logoff?
or set one session userid and query the db on each page to get the rest of the data?
this is on a pretty weak server so i was concerned about using up memory.
i know there are many questions, any suggestions on the best path would be appreciated.
soshea
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

do you want to store the session data within the db or do you only want t check the login data against your database and then store some kind of information via the default session-handler (files)?
User avatar
soshea
Forum Commoner
Posts: 31
Joined: Tue Nov 12, 2002 11:22 pm
Location: Idaho
Contact:

Post by soshea »

thanx for the reply.
well, i am not quite sure what is the best way to do things. after reading more last night about how php does sessions, i am going to just have the user login data stored in postgres, and stick with the php session method where the information is stored on the server. i was mostly concerened about a pile of sess_* building up in the directory i setup. here is what i am unclear about:
1. does the session.cookie_lifetime remove the cookie when the users browser is closed when set to 0?(this is how i have it setup but the cookie was still there)
2. what method of sessions do you recommend?
thanx!
Post Reply