CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Creating Custom Session Variable upon Login

Print topic Send  topic

Author Message

Posts: 1679
Posted: 05/26/2008, 12:26 PM

How to Lookup a value upon succesful login and store it in a session variable the CCS-way,
upon pressing the login button. (As opposed to doing it on a landing page)

Based on the Internet Example Database.
Table: users
Field to lookup: first_name
lookup field: currently logged in user
table key field: user_id

Open the properties->Events for the login button, it should already have one action attached: Login.
Add an action: DLookup, it should appear below the Login action,
if not right clock the Dlookup and select 'move down'
Expression: 'first_name'  
Domain : 'users'  
Criteria: "user_id=". CCGetUserID()  
Connection: <choose from dropdownlist your current connection>  
Convert result: Integer  
Type of target: Session  
Target: sess_firstname  
That should do it, tested.

A way to test this (PhP) is to add a label to a page, BeforeShow set it to $Component->SetValue( CCGetSession("sess_firstname","XXX") );

Take care to use correct names and caps!


Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me:
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

MS Access to Web

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

Home   |    Search   |    Members   |    Register   |    Login

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