Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: basic login

by scorpio17 (Canon)
on Apr 14, 2017 at 15:52 UTC ( [id://1187941]=note: print w/replies, xml ) Need Help??


in reply to basic login

Here's a link to a simple login tutorial I wrote a long time ago:
RFC: Proposed tutorial - simple login script using CGI::Application

That should help get you started.

Replies are listed 'Best First'.
Re^2: basic login
by bigup401 (Pilgrim) on Apr 14, 2017 at 16:35 UTC

    when i look at ur tutorial. it involves mysql. what am doing i dont want to call any database or session. i just want something simple if the login details are ok stay on same page display wanted content dont move away even if there are refresh until i command to logout

    there are alot method for good login page. but am not looking for that. if u know php basic login . which doesn't involves calling database or using session

    but finally i have got some idea it seems to work now

      Despite this being a Perl site, many of us are familiar as well with other languages including PHP. In PHP sessions are used for tracking logins from one page to the next. It can involve a database or it can be in the filesystem. It can also be in a keystore like memcached. All of those are also possible in Perl.

      Now it's possible to set a cookie and honor that cookie without tracking the session on the server side. That's actually quite simple to do. If you're not tracking it on the server side, though, you don't know if the cookie is forged. That is, unless you cryptographically sign a data structure on the server that includes a session ID, user ID, expiration, and such; then make sure the ciphered text is encoded to text (perhaps using something like base64); then store that in the cookie. Then when the cookie is returned the server can decode, then decrypt it, and check its validity. I doubt if you don't understand how basic sessions are tracked with existing support in the libraries though that you're quite ready to tackle that sort of solution.

      If you don't want to use a database, use a file on the filesystem or a hardcoded check in your program.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1187941]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-19 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found