how to maintain session in PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maxjackie
    New Member
    • Apr 2007
    • 3

    how to maintain session in PHP

    i am developing an application in which i am storing some values in session
    using session_start() and then $_SESSION['customer'] = 'max' like this
    forwarding it to next page , but there is a problem like when i use back link on
    the page and try to retrieve the values through session but it doesn't work
    it didn't show any values
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    when i use back link on
    the page and try to retrieve the values through session
    What do you mean by back link?

    Comment

    • devsusen
      New Member
      • Feb 2007
      • 136

      #3
      Originally posted by code green
      What do you mean by back link?
      its basically a link to go to the previous page.

      well maxjackie, instead of writing this code

      [PHP]$_SESSION['customer'] = 'max';[/PHP]
      u can write

      [PHP]if(! isset($_SESSION['customer'])) {
      $_SESSION['customer'] = 'max';
      }[/PHP]
      this will solve ur problem.

      susen

      Comment

      Working...