Skip to main content

session_name()

session_name()

If you are wanting to use different more than one session on the same domain, (i.e. if you have several versions of the same login system in different folders or subdomains), you need to name your session before calling session_start();

For example:

// Start Session & starting vars
session_name('name1');
session_start();

There are only a few limitations to the characters… You can only use characters: a-z, A-Z and 0-9, no . so camelcase is probably wise…

Main Category
  • PHP
  •  
 
Jon Moore

Search form

Jon Moore

Tips 'n' Snips

 
  • Home
  • General
  • Drupal
    • Drupal 6
    • Drupal 7
    • Module Building
  • HTML & CSS
  • Javascript
  • jQuery
  • PHP
    • CodeIgniter
    • Handy Functions
    • MySQL
  • WordPress
  • About
  • Contact

BBC Technology News

  • Facebook removes 'gay sex for rent' posts
  • Google's SMS replacement ready to launch
  • Robot visits a pub for Westworld promotion and other news
  • God of War: Giving gaming new emotions
  • Robo farmers
More

Sitepoint

  • How to Migrate a Simple Web Server from Azure to Alibaba Cloud
  • JavaScript Design Patterns: The Singleton
  • JavaScript Performance Optimization Tips: An Overview
  • How to Build a Serverless, CMS-powered Angular Application
  • Reliable UX & UI Tools for Your Projects in 2018
More

Heart Internet

  • Why interactive content will work for your clients
  • 5 reasons developers are switching to Vue.js
  • Website of the Month March 2018 – Cartmel Village!
  • A guide to GDPR and what to do to prepare
  • 5 things you didn’t know a browser could do!
More
 

Backend Coders

  • PHP
  • Handy PHP Functions
  • PHP MySQL

Frontend Coders

  • HTML & CSS
  • jQuery
  • Javascript

CMS/CMF Systems

  • Drupal
  • Drupal 6 Specific
  • Drupal 7 Specific
  • Drupal Module Building
  • WordPress

About

  • Home
  • About
  • Contact
 

© Jon Moore 2018

All stock images are from www.istockphoto.com