Solved

W0rking with Seesions

Posted on 2008-10-18
7
194 Views
Last Modified: 2012-05-05
Hello,

I need a seesionto be created pnce User is logged in , and end his seesion once he log's out.
Please tell me is this right way to go further:

I'm getting null values in the transition pages, once the session variable is created.

Thanks.
Login.aspx:

Session["User"]= tbUser.text;
 

Transaction.aspx:

Session[user];
 

tbID.text = Session[user].ToString();

Open in new window

0
Comment
Question by:DevIndian
7 Comments
 
LVL 8

Expert Comment

by:vsudip
Comment Utility
0
 
LVL 13

Expert Comment

by:sm394
Comment Utility
change that
tbID.text = Session[user].ToString();
To
tbID.text = Session["User"].ToString();
0
 

Author Comment

by:DevIndian
Comment Utility
No still ,I'm getting Null values
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 13

Assisted Solution

by:sm394
sm394 earned 100 total points
Comment Utility
when you set session i assume there

Session["User"]= tbUser.text;

debug and check what value is being assigned
0
 
LVL 16

Accepted Solution

by:
Gyanendra Singh earned 200 total points
Comment Utility
on Login.aspx.cs

on button submit add this
Session["User"]= tbUser.text;

and on Transaction.aspx.cs

on page load event add this
tbID.text = Session["User"].ToString();

remove this Session[user];


0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 200 total points
Comment Utility
Modifying the solution provided by BondInASP a little bit

on Login.aspx.cs
      on button submit add this
      Session["User"]= tbUser.text;

and on Transaction.aspx.cs
      on page load event first check whether the session is still valid or not
      check this before retriving user from session
      if (Session["User"] != null)
            tbID.text = Session["User"].ToString();

remove this Session[user] = null;
0
 

Author Comment

by:DevIndian
Comment Utility
Thanks
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now