I want Forms Authentication only during session

P

Peter Royle

Hello out there,

I am building an ASP.NET app that uses Forms authentication (as that
seems the simplest way to do it). It works fine "out of the box". But
what I would like is for the authentication to last only for a user's
session, then the next time they try to connect, they are given the
Login.aspx form again (their environment is not secure, so I want to
force a logon each time). I'm not clear how I can achieve that.

Any (simple) suggestions?

Cheers,
Peter Royle
 
P

Paul Hobbs

This is very simple to implement:

When the user is authenticated, and you set the session cookie, make the
Persistent Cookie parameter False:

FormsAuthentication.RedirectFromLoginPage(tbEmail.Text, False)

Hope this helps,

Paul Hobbs
 
P

Peter Royle

Paul Hobbs said:
This is very simple to implement:

When the user is authenticated, and you set the session cookie, make the
Persistent Cookie parameter False:

FormsAuthentication.RedirectFromLoginPage(tbEmail.Text, False)

Hope this helps,

Paul Hobbs

Thanks, Paul. That's what I wanted. I knew I'd seen it somewhere!

Peter
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top