GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  PHP
Go To First  |  Previous Question  |  Next Question 
 PHP  |  Question 71 of 74    Print  
session_register and $_session
What is the difference between session_register and $_session?


  
Total Answers and Comments: 4 Last Update: July 16, 2009     Asked by: krr_r25 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Biswajit769
 
session_register() is used for register one or more global variables with the current session. While $_SESSION[] array is used for storing one or more variables with in theĀ current session array. session_register() depends upon register_global is enable or disable, If it disable it will not work.

Above answer was rated as good by the following members:
birajghosh
June 02, 2009 06:57:45   #1  
narendrapal_sngh Member Since: June 2009   Contribution: 1    

RE: session_register and $_session
session_register returns boolean type output and $_session returns string data.
 
Is this answer useful? Yes | No
June 09, 2009 03:15:12   #2  
bhavsarpr Member Since: June 2009   Contribution: 6    

RE: session_register and $_session

Following are differences between session_register and $_SESSION

1. session_register function returns boolean value and $_SESSION returns string value

2. session_register function does'nt work if register_global is disabled. $_SESSION works in both case whether register_global is disabled or enabled. So using $_SESSION for session variable manipulation is more appropriate.

Please let me know if anyone has anything to add into this.


 
Is this answer useful? Yes | No
June 11, 2009 03:16:55   #3  
akaash19 Member Since: June 2009   Contribution: 2    

RE: session_register and $_session
session_register() is a function .$_SESSION{} is a superglobal array.
session_register() is used to register a session variable and it works when register_globals is turned on.
$_SESSION works in both case.

 
Is this answer useful? Yes | No
July 16, 2009 06:01:53   #4  
Biswajit769 Member Since: May 2009   Contribution: 2    

RE: session_register and $_session
session_register() is used for register one or more global variables with the current session. While $_SESSION[] array is used for storing one or more variables with in the current session array. session_register() depends upon register_global is enable or disable If it disable it will not work.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape