CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.security Tags:
Item Type: NewsGroup Date Entered: 10/20/2003 1:16:18 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 56 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
rsmoke21
Asp.Net User
Persist Login Credentials and Session State10/20/2003 1:16:18 PM

0/0

Hopefully someone out there can help me with this problem! I don't think it is that hard, but I've been hitting my head against it for a few days! Anyways, I have an ASP.NET site that uses Forms Authentication. When the user logs in they can check an option to have their login information remembered. If they do this I set the persist setting in FormsAuthentication to true. Also, when they login i grab their UserID from the database and store it in a session variable. This is used throughout the site for numerous reasons.

The problem I'm encountering is when a user selects the "remember login" option, browses the site, exits the browser (clearing session state), then at some later point re-opens the site. The user is not forced to login but I now do not have the session variable with the user's id! I need the ID!

Basically I need a method to check if a user is authenticated (logged in) but the session state variable is not set. It seems this code should go somewhere in the Global.asax file but I can't seem to get the right event and get the code working. One solution would be to create a base Page class that includes the code and have every page inherit from this, however, I would rather put the code in the Global.asax file and not create this extra layer of inheritance. Thanks for any help!

Smoke
Alex Silva
Asp.Net User
Re: Persist Login Credentials and Session State10/20/2003 2:53:30 PM

0/0

Hi!
you can do it on the "Session_Start" event of Global.asax
you'll check if the user already have a authentication ticket. if true, you can retrieve the user data from the cookie on and save it on a session variable. On this way, you'll always have the user data, whenever his cookie is persistent or not.

Alex Silva
rsmoke21
Asp.Net User
Re: Persist Login Credentials and Session State10/21/2003 12:38:24 PM

0/0

Makes sense Alex. Thanks for the idea I can't believe I didn't think of this. I must have been caught up using the Application_Authorize event. I will give your idea a try.

Smoke
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
.NET Framework Essentials Authors: Thuan L. Thai, Hoang Q. Lam, Pages: 363, Published: 2003
The Web Application Hacker's Handbook: Discovering and Exploiting Security Flaws Authors: Dafydd Stuttard, Marcus Pinto, Pages: 736, Published: 2008
Professional C# 2005 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Allen Jones, Pages: 1540, Published: 2006
Programming Microsoft SQL Server 2000 with XML Authors: Graeme Malcolm, Pages: 448, Published: 2002

Web:
Sarge's Blog: CFMX: Cached Login Credentials I recently wrote TechNote 19490, Login credentials persist past logout when specifying LoginStorage=Session in response to this forums thread: ...
Best Practices: Fast, Scalable, and Secure Session State ... Similarly, this is how you indicate read-only session state: ..... NET 2.0 configuration encryption to protect the login credentials by encrypting the ...
Session-State Modes The logon credentials for an account that has permission to create a ... NET 1.1 can direct persistent session state to a SQL Server that has the ASP. ...
Log-on service providing credential level change without loss of ... The login credentials obtained are selected from a set of credential types that, ..... In configurations providing credential upgrade, persistent session ...
Encapsulating Session State Management Or, user credentials specified at login are not kept until logout. .... and components may even be loaded into persistent scopes like SESSION: ...
unlimited session timeout? - ASP.NET Forums Please provide Login Credentials !');location.href='. .... disable session state to prove that authentication does not need session.--> ...
Managing Sessions and State with PHP | O'Reilly Media May 18, 2006 ... Page state is much smaller in scope than session state. ... The rest of the changes allow you to submit login credentials to the application ...
ASP.NET.4GuysFromRolla.com: Dissecting Forms Authentication Jul 20, 2005 ... At the login page, our end user will enter her credentials - typically a ... That is, with session variables the state is lost once a user's ...
The stateless state Jul 22, 2008 ... On the other hand, using login credentials like this is not an abuse of the spec . ... The client maintains only one piece of state—a session ...
Cache and Persistence of the ReportDocument Object Model NET for preserving state. Cache is functionally similar to the Application object ... Note In most cases, use Session to persist ReportDocument instances. ...




Search This Site:










open source code for rpn calculator using c#

security object

some questions from newbie!

modifying styles drop down for freetexteditor

hashed passwords

flextex links problems

gridview

accent words

calendar control with just year and month [no date]

asp.net development under windows xp pro / iis 5.0 vs. windows server 2003 / iis 6.0

"select" a button when user types in a textbox

visual studio causing computer to reboot without notice!

crippling error, please help!

one text box changes another

benifits of using authentication modes in .net over classic asp

can someone recomend me a best free menu web control

applicationname

printer friendly page without url being printed

menu control

custom redirects

problems using vss and web application project

multiple sitemaps

control array

integration of users asp.net 2 secrurity (membership)

xml firewall

3.0.12 general installation issue ?

create user wizard

display by date/time

adding sessionstate tag throws error in web.config file

simple problem? cmab xml

 
All Times Are GMT