Ending Sessions in PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinot85
    New Member
    • Aug 2007
    • 53

    Ending Sessions in PHP

    Hi everyone,
    I have no idea about how to use sessions in PHP. When i click logout button, my session should get lost. If i press back button in the browser it should not go to the server page.It should show message like session ended. Please share your ideas. whether i need to use javascript for doing so? or else some server side code? Help me soon.


    Kind and Regards,

    Vinoth
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    the session must be explicitly destroyed or expire to actually end. you should check your logout script for that. other than that, have a look at PHP: Sessions - Manual

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      You can either destroy the session with session_destroy, or unset a specific part of the session array using the unset function.
      That would essentially close the session.

      Comment

      Working...