This is a discussion on "Session Variables...." within the Classic ASP section. This forum, and the thread "Session Variables.... are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Session Variables....
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Session Variables....
Hello there. I have a few questions about Session Variables... Is it ok to create A user's Area with them? Is it the best/only way? Please let me know. Using them is easy, just don't know if it's the best thing to do.
|
|
|
|
#2
|
|||
|
|||
|
IMO sessions are fine, or a cookie. I usually use cookies out of habit because back when I started sessions were seen as evil but when later versions of ASP came out they fixed all the problems with them.
|
|
#3
|
|||
|
|||
|
Well, here's what I have created... www.haeglodesigns.com Go to the log-in portion of my site... It's located near the bottom of the page. Here's the Info. Username: guest Password: dojo123
Please make sure that what you enter is lowercase or it will not work properly (I am working on that...) |
|
#4
|
|||
|
|||
|
Lookin good!
You could easily convert the form values (username/password) to lower case defore checking them against your database, use the LCase() function. |
|
#5
|
||||
|
||||
|
May I point out, that username / password pairs should not really be stored in the session, or a cookie.
Its a far from impossible task to open up a cookie in notepad to grab information. I would definitly consider using a one-way hashing algorythm to store passwords in a database. I would then store an ENCRYPTED username / password in the session (or cookie).... each page will decode this info, make a one way hash from the password and compare it to the hash in the Database. This way is secure and as you are dealing with clients personal information, that they entrust you with, you should never store (or send) this info across a network in plain text. Use:- enctype="multipart/form-data" and the POST method for forms that send user/pass data across the net. Hope this helps. Rob (BTW: I do have a vbscript class that does one way hashing and encrypt / decrypt... let me know anyone who wants it.)
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#6
|
|||
|
|||
|
Cool
|
|
#7
|
||||
|
||||
|
Maybe this class will help you with hashes, decode & encode:-
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#8
|
||||
|
||||
|
that looks AWFULL! fair enough it might be safe but, I have an encrypt/decrypt aspmodule that does the lot in 30 lines of code, and if you spend a little more time with it, it's irreversible...
you are fine to save the password as a cookie as long as it's encrypted because there's nothing anyone can do with a load of junk. you should also store your passwords that way. then all you do when the user types in the password is encrypt the input and make sure it matches the stored value. also, that will allow your users to "stay logged in unless they logout"...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
#9
|
||||
|
||||
|
<blockquote id="quote"><font size="1" face="geneva, verdana, arial" id="quote">quote:<hr height="1" noshade id="quote">that looks AWFULL!<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">May I point out that the above CLASS performs one way hashing, AS WELL AS base 64 encoding (and decoding)
Whilst it probabally could be shortened A LITTLE, you must remember it's an encrypt / decrypt and hashing tool, all in one. If you have something that does all the above in just 30 lines then I severely question it's ability to perform a secure encode and hash, and I'll ask you to post the code here for my close scrutiny.
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#10
|
|||
|
|||
|
what do I do to make that work? I don't know anything about encrypting... do I have to paste it inside of the form? Do I make it a seperate file and include it.. or submit my form to it, or what? lol, I haven't learned THAT much just yet :wink:
|
|
#11
|
||||
|
||||
|
Court Jester... use the file as an include!
then create an instance of the class! something like this to encode:-
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#12
|
|||
|
|||
|
Thanks Rob!
|
![]() |
| Tags |
| session, variables |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP Problems with Session Variables... | JustinStudios | PHP Forum | 5 | Jan 17th, 2008 05:05 |
| Flash and PHP Session Variables | saxy46 | Flash & Multimedia Forum | 0 | Jan 27th, 2007 18:21 |
| Session variables | ideleon | PHP Forum | 2 | Feb 7th, 2006 08:04 |
| Session Variables | ekendricks | Classic ASP | 4 | Dec 19th, 2003 06:33 |
| Session Variables | ekendricks | Classic ASP | 7 | Aug 26th, 2003 10:42 |