www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Session. I'm confused yet again

  1. #1
    Join Date
    Jun 2008
    Posts
    118

    resolved [RESOLVED] Session. I'm confused yet again

    OK

    to start a session we use

    PHP Code:
    session_start(); 
    on page1 and then we set up variables.

    But!!!

    I don't seem to get the session to work on page2.
    I usualy use cookies, but thought it might be good for me to know how to transfer a session on page2.

    whichever tutorial I checked on the web, never deals with this

  2. #2
    Join Date
    Oct 2007
    Location
    Sweden
    Posts
    225
    You must have session_start(); on page2 aswell.
    You must have session_start(); on EVERY page you use $_SESSION variables

  3. #3
    Join Date
    Jun 2008
    Posts
    118
    I've found out my problem It's been connected to the error I make when writing code.

    As I used alot of switch statements, I was not puting session_start() in every "case", but just in the "default".

    Took me some time though.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles