Erollisi Marr - The Nameless

Go Back   Erollisi Marr - The Nameless > NON EQ Stuff (Real life, other games, etc.) > Technical Related


Reply
 
Add/Share Add/Share Thread Tools Display Modes
Old 08-26-2003, 11:57 PM   #1
cnjmorris
Registered User
 
Join Date: Nov 2002
Posts: 925
Default Are using sessions as easy as....

Are using sessions as easy as:

To Set:
Session("loginstatus") = "loggedin"

To use:
If Session("loginstatus") = "loggedin" Then
'Grant access code
Else
'Deny access, inform user
End If


This will keep the user logged in until they leave the site? (vbscript)

Also I am wondering about cookies... is the code below going to work to keep someone logged in for a week?

Response.Cookies ("classtest")("status") = "loggedin"
Response.Cookies ("classtest")("username") = strUserName
Response.Cookies ("classtest")("clearance") = strClearance
Response.Cookies ("classtest").Expires = Date + 7
__________________

Catcen, Level 65 Beastlord.

Newbie for life.
cnjmorris is offline   Reply With Quote
Old 08-27-2003, 02:02 AM   #2
Deviator
Registered User
 
Join Date: Nov 2002
Location: Dallas, Texas
Posts: 567
as for sessions, in php you have to start the session, register the variable (in your case loginstatus=loggedin when they sucessfully log in) then do the if statement at the beginning of each page you want secure. i would assume asp is close to that. and yes, cookies would allow them to stay logged in for as long as the cookie is active. you could also register a session variable for their name, permission level, and even site templates if you want to go that far with it.

it is not always good to use cookies though. for instance if the user is on a public machine (library, cafe, etc). you might want to offer them the ability to use or not use cookies to keep just anyone from having access to their stuff.
__________________
Master Artisan Deviator - 89 Shaman - Whit`s End
Alchemy 300(345) - Baking 300(345) - Blacksmithing 300(345) - Brewing 300(345)
Fletching 300(345) - Jewelry Making 300(345) - Pottery 300(345) - Tailoring 300(345)
Deviator is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump


All times are GMT -8. The time now is 08:29 AM.


Powered by: vBulletin. Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.