AudiTT @ Mci
|
| Posted: 03/13/2002, 11:45 AM |
|
Hello, I am setting session variables during the login in my ASP, and I want to call these from a .HTML or .HTM page. I think I have to do this by setting the session variables a coockies.. but I have confused my self on this and need some help.
Here are my sessions.
Session("UserID")
Session("UserRights")
Session("UserEmail")
Session("user_right")
Session("reuser_right")
Session("manager_right")
Session("cat_right")
Session("admin_right")
Session("finance_right")
I am setting them like this:
Session("UserID") = CStr(DLookUp("Active_Accounts", "UserID", "UserName =" & ToSQL(sLogin, "Text") & " and UserPassword=" & ToSQL(sPassword, "Text")))
Session("UserRights") = CLng(DLookUp("Active_Accounts", "Sec_Level", "UserName =" & ToSQL(sLogin, "Text") & " and UserPassword=" & ToSQL(sPassword, "Text")))
Session("UserEmail") = CStr(DLookUp("Active_Accounts", "Email", "UserName =" & ToSQL(sLogin, "Text") & " and UserPassword=" & ToSQL(sPassword, "Text")))
Session("user_right") = CStr(DLookUp("Active_Accounts", "user_right", "UserName =" & ToSQL(sLogin, "Text") & " and UserPassword=" & ToSQL(sPassword, "Text")))
Session("reuser_right") = CStr(DLookUp("Active_Accounts", "reuser_right", "UserName =" & ToSQL(sLogin, "Text") & " and UserPassword=" & ToSQL(sPassword, "Text")))
Session("manager_right") = CStr(DLookUp("Active_Accounts", "manager_right", "UserName =" & ToSQL(sLogin, "Text") & " and UserPassword=" & ToSQL(sPassword, "Text")))
Session("cat_right") = CStr(DLookUp("Active_Accounts", "cat_right", "UserName =" & ToSQL(sLogin, "Text") & " and UserPassword=" & ToSQL(sPassword, "Text")))
Session("admin_right") = CStr(DLookUp("Active_Accounts", "admin_right", "UserName =" & ToSQL(sLogin, "Text") & " and UserPassword=" & ToSQL(sPassword, "Text")))
Session("finance_right") = CStr(DLookUp("Active_Accounts", "warehouse_right", "UserName =" & ToSQL(sLogin, "Text") & " and UserPassword=" & ToSQL(sPassword, "Text")))
How can I use them in a HTML page insttead of ASP, and how can I force a redirect if the valu is false on the last 6 sessions in my list???
Thanks for your help.
|
|
|
 |
Alex Alexapolsky
|
| Posted: 03/14/2002, 2:21 AM |
|
Your session variables are all stored in cookie named
ASPSESSIONIDFFFFZVFF
you will need to parse this cookie to get corresponding value-name pairs
via javascript
|
|
|
 |
AudiTT @ Mci
|
| Posted: 03/14/2002, 9:59 AM |
|
Ok, I found this code to get the cookie, but how do I set it from my ASP page... Like for the UserID session I am generating during the login.
The, what should I do, or can you change this code to work?? Sorry alex, I am totaly blank this week... and need the help..
bc
//Get cookie routine by Shelley Powers
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
// if cookie exists
if (offset != -1) {
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset);
// set index of end of cookie value
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
|
|
|
 |
|