• Contact
  • About
Jon Moore Tips 'n' Snips
  • PHP
    • MySQL
    • Handy Functions
  • jQuery
  • Javascript
  • HTML & CSS
  • Drupal
  • WordPress
  • RSS Feed

session_name()

Posted in: PHP
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...

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…

Related posts:

  1. htmlspecialchars()
  2. Delete Sessions

This post has had 13 views

Tags: Amp, Folders, Login System, Session Name

No Comments

Start the ball rolling by posting a comment on this article!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Featured Stories
  • Most Viewed
    • JavaScript Dot Operator List - 306 views
    • Drupal Views – Table Sort - 145 views
    • Get a users IP Address - 131 views
    • PHP Email Contact Form - 121 views
    • Check if user is ‘logged in’ or is ‘admin’ - 114 views
    • WordPress – How to Increase Maximum upload file size: 2MB - 107 views
    • IE session bug is solved - 97 views
    • IE Blocking iFrame Cookies - 93 views
    • Create getElementsByClassName() function for use in IE - 80 views
    • mysql_insert_id() - 61 views
  • RSS MJ Digital
    • LDAP authentication with Active Directory using PHP
    • PHP display errors at runtime
    • Track XML or server-side files using Google Analytics
    • Anatomy of a good internet marketing campaign
    • Does Google prefer shorter domain names
    • Bulk filename rename tool
    • Another website award
    • How to use Twitter for business
    • PHP upload, resize and crop image class
    • Validate email in JavaScript or ActionScript
  • RSS Sitepoint
    • An Introduction to C
    • What’s New in Chrome 19
    • Two New Proposals to Solve the CSS3 Vendor Prefix Crisis
    • Ubuntu 12.04 LTS Precise Pangolin: Networking tips and tricks

Copyright Jon Moore. All Rights Reserved.