We can use either session_register or $_SESSION for registering session variable in php.
Find below the difference between both of them.
session_register() is a function and $_SESSION is a superglobal array.
session_register() is used to register a session variable and it works only when register_globals is turned on. (Turning ON register_globals will create mesh-ups, but some applications (e.g OScommerce) requires turning ON of register_globals)
But $_SESSION works even when register_globals is turned off.
If session_start() was not called before session_register() is called, an implicit call to session_start() with no parameters will be made. But $_SESSION requires session_start() before use.
session_register function returns boolean value and $_SESSION returns string value
session_register() function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0.
If you are not familiar with session, you can read my previous post.
More Articles...
Thursday, January 21, 2010
Search This Blog
Blog Archive
-
▼
2010
(267)
-
▼
January
(27)
- Twitter allows large-sized images in the profile?
- Is it possible to create second cPanel Account?
- Will Apple iPad kill Amazon Kindle?
- IPL News
- Sports News
- picApp.com for including images easily in blog
- Handling Date format in MySQL
- Twitter is testing Location-based Trending Topics
- Five French Journalists are going to test Quality ...
- Difference between session_register and $_SESSION[...
- Kindle Edition of our eBooks are available now
- Entire world can watch IPL on YouTube
- Drastic Twitter Follower Count increase for Bill G...
- MySQL Quiz Questions and Answers
- Job Openings for Web Development(PHP/MySQL)
- HTML Quiz Questions and Answers
- Is this Solar Eclipse?
- Javascript Quiz Questions and Answers
- How to split a string into individual characters u...
- Software Testing Quiz Questions and Answers
- Hyperlink in Google suggestions
- PHP Quiz Questions and Answers
- Google officially announces "Nexus One"
- TwitterFeed came back
- We can use Google Feedburner itself for sending tw...
- Birthday of Isaac Newton: Apple falls on Google Ho...
- Use Incognito window in chrome for doing private b...
-
▼
January
(27)

AI Course | Bundle Offer | Unlocking AI | Dream Big | Listen to Dream Big
Today's Deals | Timesheet | Products | SQL ebook | Earn 50% commission
About | Privacy | Follow | TOS | WhatsApp | Contact
I may earn a commission from Amazon affiliate links
1 comment:
Your Article regarding "Difference between session_register and $_SESSION[] in php" really rocks. Your Articles are much more informative than any other web blog. Thanks for providing valuable Post.
Post a Comment