Welcome Guest, Not a member yet? Register   Sign In
Session not storing data across functions?
#8

[eluser]fireproofsocks[/eluser]
I enabled logging, but nothing was written to the log file... not sure if there are permission errors on the log files, but it's possible. I've seen a few other weird things on this client's server, so I'm not too surprised if this is another one of them.

Thanks Colin. I'm not sure if I follow your reasoning, and I think I'm getting confused by CI's implementation of its "sessions". The only thing I'm attempting to store in the session are the following:

1. Whether or not the user has successfully logged in (TRUE | FALSE)
2. Whether or not the user has agreed to the latest terms and conditions (TRUE | FALSE)
3. The user's id (his email address in this case)

If there's another way to code this, I'm not seeing it. We can't rely on cookies because the visitors may have them disabled, so the only thing we use cookies for is for optionally remembering the user's info to pre-populate the login form when they return to the site. That's only an "ease of use" situation; the site is designed to function without cookies.

When I think of a session, I think of the data being stored on the server (usually in the temporary directory configured in the php.ini file: session.save_path ). When I think of a cookie, I think of data being stored on the user's computer, but your reply seemed to infer that CI writes data to the user's cookies with its session library (which is a confusing bit of nomenclature). Is that correct? Is CodeIgniter's solution to load-balanced servers to write session info as cookies OR to use the database configured in the config/config.php file? That makes some sense, but I can see why there might be problems with it.... actually, this is probably exactly why I was having problems with this... one of my browsers is set to ignore cookies, which would get me into trouble when the session library actually tried to write one... since I thought I was writing SESSION information, it never crossed my mind that COOKIES may have been involved.

I think I'll have to do this with straight PHP instead of using CI's session library.


Messages In This Thread
Session not storing data across functions? - by El Forum - 01-29-2010, 11:32 PM
Session not storing data across functions? - by El Forum - 01-29-2010, 11:36 PM
Session not storing data across functions? - by El Forum - 01-30-2010, 12:17 AM
Session not storing data across functions? - by El Forum - 01-30-2010, 12:21 AM
Session not storing data across functions? - by El Forum - 01-30-2010, 12:52 AM
Session not storing data across functions? - by El Forum - 01-30-2010, 01:31 AM
Session not storing data across functions? - by El Forum - 01-31-2010, 07:28 PM
Session not storing data across functions? - by El Forum - 01-31-2010, 08:58 PM
Session not storing data across functions? - by El Forum - 01-31-2010, 09:08 PM
Session not storing data across functions? - by El Forum - 01-31-2010, 09:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB