Msg#: 7536 posted 11:21 am on Mar 28, 2005 (gmt 0)
I've recently joined the php crowd and have until now been working with my own systems.
In my old system sessions where recorded in a database usign a combination of user_agent, IP and a timeout to follow a visitor around the site, trying to avout proxy and NAT issues. Not a perfect system, but good enough for most purposes and more robust then cookies and less intrusive then query strings.
Could I use PHP session variables using my own session tracking mechanism? In other words, can I get my session ID from my database and forward it to the PHP session handler and access ressources from that session?
I want to take advantage of the resource savings that come with storing things like database connections and file handles in sessions variables.
How can I get the current session ID and how can I set it?
Outside of cookies or the query string about your only other option is to embed the session id in a hidden form variable. Somehow you have to make the connection/relation when using HTTP. Personally, I prefer using cookies.
Anyway, the zend tutorial mentioned is a decent read and can be found on the PHP manual page for session_set_save_handler() [php.net].