SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Wizard dominique's Avatar
    Join Date
    Dec 2000
    Location
    orbis terrarum
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Concurrent sessions

    Hello,

    I need users to be able to log into separate sections of my website with different credentials. I'm using sessions with cookies now and I cannot separate the sessions (i.e. this session goes to this section, that session to that sections, etc.). The server always uses the same session when I call session_start().

    Is there a way to keep seprate sessions with cookies? Or am I forced to append SID to the URLs?

  2. #2
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can run different sessions.

    you need to decide which session you want to start/resume before you call session start.

    the default session name is PHPSESSID, but you can change that.

    PHP Code:
    if (we should start/resume section 1 session) {
        
    ini_set('session.name''section1');
    } else {
        
    ini_set('session.name''section2');
    }

    session_start(); 


Bookmarks

Posting Permissions

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