DevPinoy.org
A Filipino Developers Community
            

how to destroy SessionVariables when navigating away from the page

Latest post 06-23-2008 6:08 PM by SuperNoob. 7 replies.
  • 06-05-2008 8:42 PM

    how to destroy SessionVariables when navigating away from the page

    hi po...

    panu po ba mag destroy ng Session  pag lilipat ng ibang page using the menu....

    I only have access to my Module...  yung iba like the MasterPage e la ko access..

    kung meron lang sana ko access sa ibang module e lalagyan ko n lng ng function during Onload nila na idedestroy yung mga session sa

    module ko.

    kaya ngayun naiisip ko baka may event na sa module ko na parang "BeforeUnload" tapos kill all session na ginamit ko.

    hahaha merun po b nun?

    ty po

    • Post Points: 35
  • 06-11-2008 7:38 PM In reply to

    • modchip
    • Top 10 Contributor
    • Joined on 02-09-2006
    • Ivalice
    • Posts 589
    • Points 8,345

    Re: how to destroy SessionVariables when navigating away from the page

    Hey, maybe this reference could give you an idea to solve your problem: http://msdn.microsoft.com/en-us/library/system.web.ui.page_events.aspx

    Good luck!

     

    Filed under:
    • Post Points: 5
  • 06-19-2008 9:00 AM In reply to

    • patrick
    • Top 50 Contributor
    • Joined on 01-30-2006
    • Posts 24
    • Points 375

    Re: how to destroy SessionVariables when navigating away from the page

    How about Session.RemoveAll(). Although I was thinking that putting this line in every Page_Load event is redundant. Have you tried exploring the events in the global.asax?

    • Post Points: 20
  • 06-19-2008 11:58 PM In reply to

    Re: how to destroy SessionVariables when navigating away from the page

     nope, can't use removeAll kuya...

    baka madisgrasya yung mga session nung ibang modules na hindi ako ang gumagawa..

    problema wala din akong access sa global.asax, yung lead designer/programmer lang..

    salamat po

    • Post Points: 20
  • 06-20-2008 9:26 AM In reply to

    • keithrull
    • Top 10 Contributor
    • Joined on 08-08-2005
    • San Diego, CA
    • Posts 1,865
    • Points 35,665

    Re: how to destroy SessionVariables when navigating away from the page

     can you pass the HttpContext to your module? if yes, then you can access the current HttpContext via HttpContext.Current tapos dun mo idelete yung session value sa loob ng class mo.

    HTH

    devpinoy sig

    • Post Points: 20
  • 06-22-2008 6:14 PM In reply to

    Re: how to destroy SessionVariables when navigating away from the page

     HttpContext errrrr. what's that?.....

    sorry po..

    so many things to learn, so little time...

    salamat, po i'll research on that

    • Post Points: 20
  • 06-22-2008 6:31 PM In reply to

    • cruizer
    • Top 10 Contributor
    • Joined on 12-13-2005
    • Singapore
    • Posts 897
    • Points 14,750

    Re: how to destroy SessionVariables when navigating away from the page

    sa tingin ko hindi practical ito, humanap ka na lang ng ibang paraan para magawa yun gusto mo. kasi web is stateless, kaya nga may session. everytime you access a page, it tries to recreate context by recalling the session variables, etc. might as well wag ka na gumamit ng session vars at magrely ka na lang sa viewstate at ASP.NET postback cycle.

    yun naman onunload event ng javascript, eh kahit na anong page puntahan mo magtitrigger yun event na yun. so di rin practical.

    http://devpinoy.org/blogs/cruizer
    Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
    • Post Points: 20
  • 06-23-2008 6:08 PM In reply to

    Re: how to destroy SessionVariables when navigating away from the page

    ganun nga po ginawa ko for the meantime....

    kaya lang todohan sa panget ng codes.... super rektahan

    parang sa classic ginawa ko ,except walang Sesssion, relying heavily on queryString

     

    kaya lang kase pakiramdam ko yun yung mas magandang solution eh...

    yung i destroy ang isang specific na session on an event like beforeUnloading a page.

    • Post Points: 5
Page 1 of 1 (8 items) | RSS

Copyright DevPinoy 2005-2008
Powered by Community Server (Commercial Edition), by Telligent Systems