FBA & Session State

S

- Steve -

I use forms based authentication and I've been putting the username in
Session State (Session["UserName"]).

Then when a user posts I check that Session["UserName"] != null else I
Session.Abandon() and Response.Redirect("logon.aspx") since that seems like
a graceful way to handle timeouts, session state losses (bin directory was
updated for example).

This doesn't seem like a reliable way to do it though. I get weird things
happening like SOMETIMES if I close the browser, then re-open a link I can
access the page without logging in but then when I post (ie I hit submit or
such) it asks me to logon.

How should I be handling this.
 
G

Girish bharadwaj

You should really consider reading up on "Forms authentication" in asp.net.
That allows you to provide a login.aspx, handles timeouts, handles many of
the customizations..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top