How to log a user out/switch user


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, I lied, I have another question (in addition to the one in the previous post).



Wouldn't the BeforeSessionLock event be the place to handle special stuff related to locking/logging in? I.e. I could set a flag in the MyApplication class (to continue with your example) to indicate that its session locking, I could save/undo changes to forms as needed etc (likely calling static methods in the MyApplication class). Then the login form would be cleaner and only have to deal with exiting. And would the best place to handle this event be in the MyApplication class? Am I really starting to get this!??!!? Wow
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Is using the "End" statement in vb enough?

This is the ultimate "SHUT DOWN NOW" command Smile  Calling this will shut down the message pumps and logically exit the process.  Application.Exit() will not work (properly anyway) because you are running through an SF application. 

We always create a shared ShutDown method that does everything we need it to.  This was we can access from more than one location if need be.

Wouldn't the BeforeSessionLock event be the place to handle special stuff related to locking/logging in?

If this meets your needs then sure.  The way I mentioned earlier would just give you the ability to shut down your application from anywhere if you needed to.

Am I really starting to get this!??!!?

I believe you are Wink

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, I'm definitely getting it. I added an ExitApp method to my sealed static MyApplication class. I call it from the login form and will be calling it from any other place I need to shut down code (like the unhandled exception handler). I'm using BeforeSessionLock to handle any closing/saving/undoing of forms. AfterSessionLock to clear a flag that indicates that the session is locked BigGrin (unless this is already available somewhere and I missed it).

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search