Instead of describing the entire application you are building and asking me how to do it (which I'd have to write a book to detail out), please just ask a single question about a single issue where you are getting stuck.
Do you want to know how to clear a session? How to log someone out programmatically? If you want help building the entire thing then we would have to use a premier support ticket. If you can identify the current issue you are having, then I can try to describe how to get past it so you can keep going on your own, but I can't write an entire tutorial for you through the forums.