Methods of Session Object
| Published on 5/22/2008 by Dotnetindex More articles in ASP
|
Session object is a very useful helper to store and track information for web clients. When you've create a session object, a cookie will be sent to client's browser and thsi will be used to store data. Session object contains three methods: Abandon, Contents.Remove and RemoveAll <% session("username") ="demo@demo" session.abandon .... blah blah ..... response.write session("username") %> Still we can call existing session here, but after browsing all data will be gone. Contents.Remove & Contents.RemoveAll Simply this method deletes an/all item(s) from the contents collection. Similiar usage can be used for Application object. <% session("username") ="demo@demo" Session.Contents.Remove("username") %> Using RemoveAll method we can delete more than one session variable. <% Session.Contents.RemoveAll() %> |
no comments submitted



