473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sessions and IIS5.1

Context: WinXP Pro, IIS5.1, PHP5.03

Simplified:

the page http://myserver/myvirtualdir/index.php contains

<?php
echo 'here';
session_start();
echo 'there';
?>

but it only echoes 'here', it doesn't do anything after the session_start.

What is wrong? The code or maybe the session settings in php.ini ?
(Those settings have not been changed in comparison to the session settings
in php-ini-recommended)?

peter j. veger, best netherlands

Jul 17 '05 #1
6 1734
Peter J. Veger wrote:
Context: WinXP Pro, IIS5.1, PHP5.03

Simplified:

the page http://myserver/myvirtualdir/index.php contains

<?php
echo 'here';
session_start();
echo 'there';
?>

but it only echoes 'here', it doesn't do anything after the session_start.

What is wrong? The code or maybe the session settings in php.ini ?
(Those settings have not been changed in comparison to the session
settings in php-ini-recommended)?

peter j. veger, best netherlands


Hoi Peter,

Did you lookup session_start() at www.php.net?
I think not. :P

This is what is says:

-------------------------------------
Description
bool session_start ( void )

session_start() creates a session or resumes the current one based on the
current session id that's being passed via a request, such as GET, POST, or
a cookie.

This function always returns TRUE.

Note: If you are using cookie-based sessions, you must call
session_start() before anything is outputted to the browser.

-----------------------------------

Groetjes,
Erwin
Jul 17 '05 #2


"Erwin Moller" <si******************************************@spam yourself.com> wrote in message
news:42***********************@news.xs4all.nl...
Peter J. Veger wrote:
Context: WinXP Pro, IIS5.1, PHP5.03

Simplified:

the page http://myserver/myvirtualdir/index.php contains

<?php
echo 'here';
session_start();
echo 'there';
?>

but it only echoes 'here', it doesn't do anything after the session_start.

did you set display_error to On ?

it's probably a session.save_path error
What is wrong? The code or maybe the session settings in php.ini ?
(Those settings have not been changed in comparison to the session
settings in php-ini-recommended)?

peter j. veger, best netherlands


Hoi Peter,

Did you lookup session_start() at www.php.net?
I think not. :P

This is what is says:

-------------------------------------
Description
bool session_start ( void )

session_start() creates a session or resumes the current one based on the
current session id that's being passed via a request, such as GET, POST, or
a cookie.

This function always returns TRUE.

Note: If you are using cookie-based sessions, you must call
session_start() before anything is outputted to the browser.

-----------------------------------

Groetjes,
Erwin

Jul 17 '05 #3

"Erwin Moller"
<si******************************************@spam yourself.com> wrote in
message news:42***********************@news.xs4all.nl...
Peter J. Veger wrote:
<?php
echo 'here';
session_start();
echo 'there';
?>
but it only echoes 'here', it doesn't do anything after the
session_start.
peter j. veger, best netherlands
Hoi Peter,

Did you lookup session_start() at www.php.net?
I think not. :P


I did
This is what is says:
Description
bool session_start ( void )
session_start() creates a session or resumes the current one based on the
current session id that's being passed via a request, such as GET, POST,
or a cookie.
This function always returns TRUE.
Note: If you are using cookie-based sessions, you must call
session_start() before anything is outputted to the browser.
Groetjes,
Erwin


I simplified too much:
- I first tried (and that did nothing)
<?php
session_start();
echo 'there';
?>
- I then tried the text first given, just to see that the page was indeed
loaded by the server.

So I still have a problem
peter j. veger, best netherlands

Jul 17 '05 #4
"Mookstah" <no*****@spam.proof.alias.net> wrote in message
news:ne********************@news.actcom.co.il...
"Erwin Moller"
<si******************************************@spam yourself.com> wrote in
message
news:42***********************@news.xs4all.nl...
Peter J. Veger wrote:
> Context: WinXP Pro, IIS5.1, PHP5.03
> Simplified
> the page http://myserver/myvirtualdir/index.php contains
> <?php
> echo 'here';
> session_start();
> echo 'there';
> ?>
> but it only echoes 'here', it doesn't do anything after the
> session_start.
did you set display_error to On ?

it's probably a session.save_path error
> What is wrong? The code or maybe the session settings in php.ini ?
> (Those settings have not been changed in comparison to the session
> settings in php-ini-recommended)?
>
> peter j. veger, best netherlands


display_error = Off
I have set it to On and also ensured that error-logging is working.
Result:
- no error displayed;
- an error logged:
PHP Fatal error: session_start() [<a
href='function.session-start'>function.session-start</a>]: Failed to
initialize storage module: user (path: ) in K:\aa\bb\index.php on line 3

This "failing to initialize storage module", is that my fault?
peter j. veger, best netherlands
Jul 17 '05 #5
Peter J. Veger wrote:

display_error = Off
I have set it to On and also ensured that error-logging is working.
Result:
- no error displayed;
- an error logged:
PHP Fatal error: session_start() [<a
href='function.session-start'>function.session-start</a>]: Failed to
initialize storage module: user (path: ) in K:\aa\bb\index.php on line 3

This "failing to initialize storage module", is that my fault?
Hi Peter,

It sounds like php cannot save the sessionfiles.
(your session-array is just serialized and saved under the PHPSESSID in a
directory.)

CHeck your php.ini and find the header about sessions.
Make sure you have set:
- session.save_path = *****
- session.save_handler = files
- session.serialize_handler = php

The above **** should be a directory on the machine that PHP can write to.
If not, PHP cannot save the files (serialized sessions-data).

Hope this helps.

Good luck.
Regards,
Erwin Moller

------------------------------------
Here is a relevant piece:

; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
session.save_path = /tmp

; Whether to use cookies.
session.use_cookies = 1

; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 1

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php

peter j. veger, best netherlands


Jul 17 '05 #6
Thank you, this is indeed the problem.

I had found it already myself!
My ini-file contained: session.save_handler = user
and I do not know how it got that value and what this means.
Now the values are correct and it works.

peter j. veger, best netherlands

"Erwin Moller"
<si******************************************@spam yourself.com> wrote in
message news:42***********************@news.xs4all.nl...
Peter J. Veger wrote:

display_error = Off
I have set it to On and also ensured that error-logging is working.
Result:
- no error displayed;
- an error logged:
PHP Fatal error: session_start() [<a
href='function.session-start'>function.session-start</a>]: Failed to
initialize storage module: user (path: ) in K:\aa\bb\index.php on line 3

This "failing to initialize storage module", is that my fault?


Hi Peter,

It sounds like php cannot save the sessionfiles.
(your session-array is just serialized and saved under the PHPSESSID in a
directory.)

CHeck your php.ini and find the header about sessions.
Make sure you have set:
- session.save_path = *****
- session.save_handler = files
- session.serialize_handler = php

The above **** should be a directory on the machine that PHP can write to.
If not, PHP cannot save the files (serialized sessions-data).

Hope this helps.

Good luck.
Regards,
Erwin Moller

------------------------------------
Here is a relevant piece:

; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
session.save_path = /tmp

; Whether to use cookies.
session.use_cookies = 1

; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 1

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php

peter j. veger, best netherlands

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chewy509 | last post by:
Hi Everyone, I'll just start, and say I am not a PHP developer (I'm a sysadmin, who has gotten lumped with a non-working website). But since I like to do this type of stuff, I though I might...
6
by: JJ | last post by:
Hi, I really need to use cookieless ASP sessions with ASP 3 (IIS5) Can I find out the session ID from the first page, then post it or send it with the url to the next page, then at the start...
5
by: Jennifer Smith | last post by:
We have an environment running ASP on IIS5, where a user logs in via an ASP login page and an entry is made to the database recording the users login time and a database session. If the user then...
11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
15
by: Jazzis | last post by:
I recently moved an application from W2K / IIS5 to W2K3 / IIS6. In the new environment user sessions expire after 2-3 minutes? I can't find any solution to this, although I found quite a few...
6
by: Paul | last post by:
Hi all, I seem to been having a problem with sessions. I have a session in the login page Session("UserLevel") = (MM_rsUser.Fields.Item("Accesslevel").Value) which doesn't seem to be visible...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.