Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 05-22-2005, 09:34 PM   #1
Registered: Oct 2003
Location: Canada
Distribution: Slackware
Posts: 340

Rep: Reputation: 30
How do -you- save STATE across web applications?

I'm having some difficulty thinking of the best solution for a login system. Basically I'm making a website with an arbritrary number of 'private' pages that may only be viewed if the user is authenticated. I'm looking into the following systems for authentication, but I'm curious what the de-facto standard seems to be. I'd like to shy away from cookies if possible...

Do you prefer to use sessions for state management? I'm having a bit of difficulty with logins/logouts and sessions (actually logouts). I'm using CGI/Perl, and been playing with the CGI::Session module all day. I like it, but I'm concerned with how to maintain state across pages. It looks like my options are:

o hidden form data (POST data)
o query string passing (GET data)
o cookies

Which do you use? Is there any other type of authentication (I was looking a bit at Apache, how is this?). At the current moment, I'm just using a plain text file for my authentication, and cookies are working pretty well. I think POST data seems a bit better, but probably more difficult to implement across many pages. I still havent thought of a good way of implementing it cleanly.

Another question, sorry. Lets say your using a session system to keep users logged in across pages. Is it a web standard to have some variable like... $_USER_LOGGED_IN or something similiar? I've been adding the username to the session, and comparing if its not a null string. I kind of make the assumption that the users logged in if ($session->param('username') ne ""). I dont particularly like this solution but I probably dont know enough about sessions yet.

Last edited by lowpro2k3; 05-22-2005 at 09:37 PM.
Old 05-23-2005, 01:27 AM   #2
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
I know nothing about PERL's state functionality but in PHP I've always used sessions, it allows you to easily save unique data locally (on the server) and access it from other server-side apps. PHP makes it really easy.
Old 05-23-2005, 06:24 PM   #3
Registered: May 2005
Posts: 378

Rep: Reputation: 33
Another vote for PHP's sessions. Simple, flexible and easy to use.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Greetings from NY State npaladin2000 Member Intro 3 08-05-2005 06:56 AM
Web Applications RySk8er30 Linux - Software 3 06-01-2005 04:47 PM
Who is Knowing about daemon applications and how to develop these applications? ms_890 Linux - Software 0 04-14-2004 03:04 AM
New Web Applications to Apache-Tomcat Web sarathmohan Linux - Software 0 10-02-2003 03:59 AM
save daily from cron job the whole Web servers data cccc Linux - General 2 09-09-2003 02:28 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration