| | |
passing sessions between pages
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2006
Posts: 82
Reputation:
Solved Threads: 0
Hi
I am having problems with sessions.
When using Internet Explorer I can pass sessions to other pages.
I cannot pass sessions when I use Mozilla Firefox.
[php]
[PHP]
I am having problems with sessions.
When using Internet Explorer I can pass sessions to other pages.
I cannot pass sessions when I use Mozilla Firefox.
[php]
PHP Syntax (Toggle Plain Text)
//at the top of the page session_start(); //value passed $last_login = $_SESSION['s_last_login'];//last user login history [/php]
[PHP]
PHP Syntax (Toggle Plain Text)
//This is my PHP.ini file session configuration below. [Session] ; Handler used to store/retrieve data. session.save_handler = files ;session.save_path = "N;/path" ;session.save_path = "N;MODE;/path" ;session.save_path = "/tmp" session.use_cookies = 1 session.name = PHPSESSID ;Initialize session on request startup. session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.gc_probability = 1 session.gc_divisor = 100 session.gc_maxlifetime = 1440 session.bug_compat_42 = 1 session.bug_compat_warn = 1 session.referer_check = session.entropy_length = 0 session.entropy_file = ;session.entropy_length = 16 ;session.entropy_file = /dev/urandom session.cache_limiter = nocache session.cache_expire = 180 session.use_trans_sid = 0 session.hash_function = 0 session.hash_bits_per_character = 4 [/php]
Have you checked if cookies are enabled in Firefox because to use sessions you need the session ID which is usually stored in a cookie. If you haven't got cookies enabled in Firefox then try enabling them and see if that makes the sessions work.
-------
Also if it does turn out to be cookies and you want to keep cookies disabled then you could a, put the session id in the url bar (not very secure) or b, use what I have made and call server side cookies. That is when you store the session values and names of the values in a database (eg. mysql). Also each value goes on its own line with the users IP address in the same row as the session value and name of value. Then when the user visits a page, the server then checks for all rows matching the users IP address. So in your case, the server side cookie would probably be the Session ID. Nice little trick if you don't like cookies.
So let us know if it is just cookies that are disallowing the session as that is all that I can think of.
-------
Also if it does turn out to be cookies and you want to keep cookies disabled then you could a, put the session id in the url bar (not very secure) or b, use what I have made and call server side cookies. That is when you store the session values and names of the values in a database (eg. mysql). Also each value goes on its own line with the users IP address in the same row as the session value and name of value. Then when the user visits a page, the server then checks for all rows matching the users IP address. So in your case, the server side cookie would probably be the Session ID. Nice little trick if you don't like cookies.
So let us know if it is just cookies that are disallowing the session as that is all that I can think of.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
•
•
Join Date: Oct 2006
Posts: 82
Reputation:
Solved Threads: 0
Thanks for the solutions.
Enabling cookie was the temporary solution.
I will store the session info in a database.
How do I accomplish the example below if I disable cookies?
example:
I have a 20 pages I need to pass the same user preferences\permissions\data across. I have been using sessions in IE and it works. I want to move to Firefox.
Note: The total of 15 to 20 preferences\permissions\data are stored in mysql DB and security is important.
I would prefer not to have to select the preferences\permissions\data from the database for each page.
Enabling cookie was the temporary solution.
I will store the session info in a database.
How do I accomplish the example below if I disable cookies?
example:
I have a 20 pages I need to pass the same user preferences\permissions\data across. I have been using sessions in IE and it works. I want to move to Firefox.
Note: The total of 15 to 20 preferences\permissions\data are stored in mysql DB and security is important.
I would prefer not to have to select the preferences\permissions\data from the database for each page.
•
•
•
•
Have you checked if cookies are enabled in Firefox because to use sessions you need the session ID which is usually stored in a cookie. If you haven't got cookies enabled in Firefox then try enabling them and see if that makes the sessions work.
-------
Also if it does turn out to be cookies and you want to keep cookies disabled then you could a, put the session id in the url bar (not very secure) or b, use what I have made and call server side cookies. That is when you store the session values and names of the values in a database (eg. mysql). Also each value goes on its own line with the users IP address in the same row as the session value and name of value. Then when the user visits a page, the server then checks for all rows matching the users IP address. So in your case, the server side cookie would probably be the Session ID. Nice little trick if you don't like cookies.
So let us know if it is just cookies that are disallowing the session as that is all that I can think of.
Last edited by R0bb0b; Sep 27th, 2008 at 4:32 pm.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
![]() |
Similar Threads
- asp, problem simliar with shopping cart (ASP)
- passing session (PHP)
- Zend PHP Certification (PHP)
Other Threads in the PHP Forum
- Previous Thread: Getting rid of previous GET data in POST form
- Next Thread: PHP table display
| Thread Tools | Search this Thread |
ajax apache api array beginner beneath binary broadband broken button cakephp checkbox class cms code countingeverycharactersfromastring crack cron curl database date decode display dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link links login mail match md5 menu mlm multiple mysql mysql_real_escape_string oop paypal pdf php problem protocol query radio random recursion regex remote script search server session sessions sms smtp soap source space sql strip_tags survey syntax system table tutorial undefined update upload url validator variable video virus votedown web window.onbeforeunload=closeme; xml youtube






