Maintaining state in php w/ session variables

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Maintaining state in php w/ session variables

    I am working in php and I am using the DW04 server behaviors for login, logout,
    and restrict page access. I noticed that each of these behaviors uses a
    session_start(). The login server behavior generates: //declare two session
    variables and assign them $GLOBALS['MM_Username'] = $loginUsername;
    $GLOBALS['MM_UserGroup'] = $loginStrGroup; //register the session
    variables session_register('MM_Username');
    session_register('MM_UserGroup'); How do I access these session variables on
    subsequent pages? Does the presence of session_start() clear the current
    session?

    jip Guest

  2. Similar Questions and Discussions

    1. Maintaining view state in datagrid
      hi all, I have a datagrid in my asp.net page. In that datagrid, i have paging enabled. And one template column having checkbox control in...
    2. Maintaining Session Variables
      I am working on building a site the sells Auto Parts. We have several dealers signed up and instead of using WWW as the host we set it up so each...
    3. Maintaining View State For Dynamically Created Controls
      I am building a custom control that I want to server as a container for child controls that can be dynamically added to this control. I can persist...
    4. Session State error -- trying to load public variables
      Never mind, I think I've realized that some of the Session vars wouldn't not be set at this page's load time. So I just declared them as name/type...
    5. Pop-up menus: Maintaining trigger button over state
      Hi folks, I want to maintain the over state of the trigger buttons/slices whilst I mouse over the triggered pop-up menus. I have tried numerous...
  3. #2

    Default Re: Maintaining state in php w/ session variables

    session_start() will either start a new session, or if one already exists,
    resume it. So it doesn't clear a current session. Macromedia is a little
    outdated now. The correct way to assign these variables to the session would
    be.... $SESSION['MM_Username'] = $loginUsername; $SESSION['MM_UserGroup'] =
    $loginStrGroup; then you can access the variables by....
    $SESSION['MM_Username'] and $SESSION['MM_UserGroup'] hope this helps

    Ross Riley Guest

  4. #3

    Default Re: Maintaining state in php w/ session variables

    Thanks for the feedback. It is much appreciated!
    jip Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139