Forum Moderators: coopster

Message Too Old, No Replies

Is there such thing as a server-side cookie?

How or should I store user data on the server

         

hanglide

11:56 pm on Aug 22, 2006 (gmt 0)

10+ Year Member



I'm new at this stuff so if this idea is completely obnoxious please feel free to tell me so.

I have an area of my site that has restricted access. When a user logs in, I'd like to check to see if they have read one or any number of "important announcements" and if they have not read them, bring them up in a window(s) (kinda like a "EULA") and ask them to confirm that they have read the content before they are allowed to complete their login.

From the reading I've done, cookies all seem to reside on the browser side but I'd rather keep the info on the server to save the user from having to click through the announcements if they logon from a different PC. Is doable or is this "bad form"?

I guess I could stuff the info into a db and look it up from there but I'd like the have the ability to simply add new announcements to a directory using some standard naming convention for the file that includes the date and then just let the script check that for every announce_date.htm that exists there is a also corresponding user_read_announce_date.txt or whatever. If not it would display the announcement instead letting them login. I would think that this way I would never have to change the script or add fields to a db no matter how many announcements are added or what the content is.

What do you think?

Thanks,

Scott

barns101

10:16 am on Aug 23, 2006 (gmt 0)

10+ Year Member



There's no such thing as a server side cookie per se, but you could use a text file to store user preferences (i.e. whether they have read the announcement(s) or not), which is sort of like a cookie. But it sounds like you're going to have all the features of a database but in a flat text file (or multiple files). I would suggest that a database to store these options would be better because it should be quicker and easier.