How to register session if register globals is off?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AzeriWEB
    New Member
    • Aug 2010
    • 8

    #1

    How to register session if register globals is off?

    How to register session if register globals is off? I created a autorization form with sesion how I can make it work when register_global s is off
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Why are you wanting to use session_registe r? It's old and deprecated.

    Comment

    • kovik
      Recognized Expert Top Contributor
      • Jun 2007
      • 1044

      #3
      register_global s allows you to access input variables without knowing where they came from. The part where you don't know where they came from is why it is deprecated in PHP 5.

      And session_registe r() is deprecated because we have a clean $_SESSION superglobal to use. There's no reason for session_registe r to exist, and the only purpose it served was confusing beginners whenever their "sessions don't work."

      To communicate with your session, make sure session_start() has been called, then then modify / read from the $_SESSION superglobal array.

      Comment

      Working...