SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    sds
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What is the way to clear all Session Variables on first page load?

    Hello everyone,

    how can i clear the session variables on page load (the first time)?

    thanks for help!

  2. #2
    SitePoint Wizard bronze trophy Tyssen's Avatar
    Join Date
    Oct 2005
    Location
    Brisbane, QLD
    Posts
    4,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Taken from here:

    PHP Code:
    <%
    Session.Contents.RemoveAll()
    %> 

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    sds
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK.

    I should be more specific. I have no problem clearing the session variables:
    HttpContext.Current.Session.Clear()
    System.Web.Security.FormsAuthentication.SignOut()
    HttpContext.Current.User = Nothing
    Response.Redirect("~/Login.aspx", True)



    I don't know how to do it onPageLoad event with isPostBack property.
    Does ASP has this event?
    I need to do the Session Clearance just for the FIRST load of the page..

    How can i do it in ASP?

    thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •