Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedHow to empty the session at logout?How to empty the session at logout?
Previous
 
Next
New Post
1/26/2010 4:54 AM
 
Hi all,

in dnn 5, how can i empty the session when the user logs out?

Thanks,
Lucian
 
New Post
1/26/2010 5:04 PM
 

ASP.NET and the DNN processes will allow things to auto expire


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
1/27/2010 1:29 AM
 
Thank you. I know that, but how do I empty it manually? I don't want to wait 20 mins or so...
 
New Post
1/27/2010 10:37 AM
 

 The command to clear out a session is Session.Abandon()

This is from the Microsoft MSDN doc

 

The Abandon method destroys all the objects stored in a Session object and releases their resources. If you do not call the Abandon method explicitly, the server destroys these objects when the session times out.

I haven't tried this, but I would suggest editing the /DesktopModules/Admin/Authentication/Logoff.ascx.vb file and adding the lines 12-13 below

 

 

   1:  Private Sub Logoff()
   2:      Try
   3:          'Remove user from cache
   4:          If Me.User IsNot Nothing Then
   5:              DataCache.ClearUserCache(Me.PortalSettings.PortalId,
   6:                  Context.User.Identity.Name)
   7:          End If
   8:   
   9:          Dim objPortalSecurity As New PortalSecurity
  10:          objPortalSecurity.SignOut()
  11:   
  12:          ' clear out Session variables
  13:          Session.Abandon()
  14:   
  15:      Catch exc As Exception    'Page failed to load
  16:          ProcessPageLoadException(exc)
  17:      End Try
  18:  End Sub
 
New Post
1/27/2010 10:39 AM
 
Thank you.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedHow to empty the session at logout?How to empty the session at logout?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out