Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

A web database forum type technical question

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
Ratty Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Oct-15-03 05:55 PM
Original message
A web database forum type technical question
OK, people are asking SQL questions now so I'm not afraid to pick anyone's brains who's willing to help me (I've already tried usenet with no luck).

I have a lot of experience setting up web interfaces to relational databases but for the first time I have to set up something very much like the DU forum. I have to allow users to register with a login and password and save data to an "account". Eeeek, I have no idea how to do this! We're not storing credit card numbers or other personal info but still I'd like it to be as secure as possible since it seems like hackers flood our sites trying to break in nowdays. Our logs are filled with crazy stunts. Thank god I managed to get us out of IIS hell and into something sensible like Apache. Woah, that's a mightmare I'm glad is over.

Anyway, I know I store the login and password encrypted within the database. The user fills in a form, I check to see if there's already a user with the same name, if not I add a new record to the database keyed to the username and store the encrypted password. I'm fuzzy on the details but I imagine I can handle this.

But here's where I'm confused. How do you keep track of the session? In a stateless environment, how do I check that the user is authorized everytime they click something to view their data, edit it, browse it, etc.? I suppose you do it with cookies somehow? Is that relatively safe? Exactly what is the form of the cookie? Is it generated randomly, or what?

Any bulletin board specialists care to give me a bit of advice? Sorry for the selfish post but bosses are beginning to breathe down my neck and I'm desperate!
Printer Friendly | Permalink |  | Top
JM Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Oct-15-03 06:03 PM
Response to Original message
1. Session state with Web Sites
As a former e-commerce guy, I used both cookie and session values. Cookies are fine if your users are willing to have them put on their drives. Otherwise, most web languages support sessions of some sort or another. We were doing sites in ASP, so we could create as many session variables as we needed and just check them from page to page. They are the equivalent to global variables in Win32 applications. Encrypted session values are even better. The downside to session values is memory. The more users and values you are storing in memory, the more memory you need on the server.

Later,
JM
Printer Friendly | Permalink |  | Top
 
GregW Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Oct-15-03 06:46 PM
Response to Reply #1
2. Yep! What JM said.
Using session variables allows you to maintain state from any page to any page, without resorting to kluges like hidden fields.

One of the problems with session variables occurs when you use a load balancer (like BigIP) that can bounce users back and forth between boxes in a server farm. In this case, you need to force persistance on the load balancer (keep user x on web box y) or store the variables somehow ... cookies on the client, or a back-end DB are options.
Printer Friendly | Permalink |  | Top
 
JM Donating Member (1000+ posts) Send PM | Profile | Ignore Wed Oct-15-03 08:19 PM
Response to Original message
3. To see a message board in action...
...check out the code in tipped cow's message board

http://www.infuseum.com/tippedcow/content/filedownload.asp?what=aspboardtrial.zip

This has the backgroups ASP pages so if you are using ASP, you will be able to follow it...
Printer Friendly | Permalink |  | Top
 
Ratty Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Oct-16-03 01:04 PM
Response to Original message
4. Thanks for the replies guys
Edited on Thu Oct-16-03 01:05 PM by Ratty
I figured sessions was one way to do it, and probably more reliable than cookies. Unfortunately I'm not using ASP, or JSP, or DBI, or any of the more common database frameworks. I'm using a homegrown perl + ADO solution that works very well for us because it's designed to do exactly what we need and we can set up a new application in less than an hour. Plus it's, Wow, lightning fast. 99% of the discussions on sessions I have seen involved ASP so it's been hard to try and translate into something more generic.

Any information you can shed on generic session solutions for an Apache web application? Something not tied specifically to ASP or another framework?
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Thu Dec 26th 2024, 05:55 PM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC