CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 SetSession

Print topic Send  topic

Author Message
LisaM
Posted: 06/07/2004, 1:31 PM

I have a login Table with the following:
Table Name: USERS
-> username
-> password
-> email
-> group
I need, at the point of login, to setsession of the email so i can use it later for many things, Forms, Labels, Grid Results, ect....
ASP. CCS
any help would be good,
Peace
Lisa
:-{}
ghtracey

Posts: 23
Posted: 06/07/2004, 4:31 PM

For ASP, search the help for Custom Session Variables. Read the topic "Create Custom Session Variables" it outlines how to do this very thing with a code example. :-)
_________________
Graham Tracey
Council of Yukon First Nations
View profile  Send private message
miller

Posts: 5
Posted: 06/08/2004, 8:01 AM

Already tried, No Luck . got any sample code......
_________________
Joe Miller
Simpleton
View profile  Send private message
zolw


Posts: 51
Posted: 06/08/2004, 9:12 AM

Lisa:

You can get any info related to an autenticated user.

The following are all default session variables created by CodeCharge Studio:

UserID - the primary key field value of the logged in user
UserLogin - login name of the user currently logged into the system
GroupID - security level/group of the user currently logged into the system

If you need to get the email you can look for it using CCDLookup.

Variable = CCDLookUp("email","USERS","user_id="& Session("UserID"), DBxxxx)

Remember to change the xxxxxx after DB using the name of your db connection.

If you have any questions please contact me,

Carlos

_________________
Zolw
http://www.xlso.com
View profile  Send private message
Lisa
Posted: 06/08/2004, 11:41 AM

I want to put it into a datasource, how do i do that????????
ghtracey

Posts: 23
Posted: 06/08/2004, 12:12 PM

Change the table and field names to match...

Function Login_DoLogin_OnClick()
Dim Connection1
If Login_DoLogin_OnClick = True Then
Set Connection1 = New clsDBConnection1
Connection1.Open
Session("User_Email") = CCDLookUp("Email","Users","User_ID="& Connection1.ToSQL(CCGetUserID(),ccsInteger), Connection1)
Connection1.Close
Set Connection1 = Nothing
End if

End Function
(mainly from the helpfile, I don't do ASP often)
From here, you can now access the current users email address anytime with
variable = Session("User_Email")

_________________
Graham Tracey
Council of Yukon First Nations
View profile  Send private message
lisa
Posted: 06/08/2004, 12:31 PM

It just cancels out, it goes nowhere now, i get a "HTTP 500 - Internal server error " but when i take your code out, i get redirected to the right page,, weird, any ideas
Thanks
ghtracey

Posts: 23
Posted: 06/08/2004, 12:38 PM

A 500 would be a code issue (obviously ;-)) but like I said I don't do ASP. I took that mostly from the help file. Maybe one of the ASP gurus can help you.

_________________
Graham Tracey
Council of Yukon First Nations
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.