Bluehost.com Web Hosting $6.95

PHP & SESSION problems

This is a discussion on PHP & SESSION problems within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I've never had problems with SESSIONS until now. It seems that I can't set SESSIONS at all. Here'...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-25-2003
Billy
 
Posts: n/a
Default PHP & SESSION problems

I've never had problems with SESSIONS until now. It seems that I can't set
SESSIONS at all.

Here's my test scripts:

I'm trying to set a session in ANY way in this script. I redirect to another
script which should show ANY sessions, but nothing is in either
$HTTP_SESSION_VARS or $_SESSION.

What gives?

<?

session_start();

$HTTP_SESSION_VARS["TEST1"] = "TEST1";

$_SESSION["TEST2"]="TEST2";

session_register("TEST3");
$TEST3 = "MY TEST";

header("Location: test2.php");

?>

##should show sessions, but there's nothing. What's going on?

<?
session_start();

print_r($HTTP_SESSION_VARS);
print_r($_SESSION);
?>

Here session info I got from phpinfo().

session
Session Support enabled
Registered save handlers files user mm

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_dividend 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /vservers/valuenews/tmp /tmp
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid Off Off






Reply With Quote
  #2 (permalink)  
Old 09-25-2003
frankly
 
Posts: n/a
Default Re: PHP & SESSION problems

Billy wrote:

> I've never had problems with SESSIONS until now. It seems that I can't set
> SESSIONS at all.
>
> Here's my test scripts:
>
> I'm trying to set a session in ANY way in this script. I redirect to another
> script which should show ANY sessions, but nothing is in either
> $HTTP_SESSION_VARS or $_SESSION.
>
> What gives?
>
> <?
>
> session_start();
>

"short_open_tag = Off" in your php.ini? :P

--
<nospam>
Email: frank.at.fake.eu.org
</nospam>
==========================

Reply With Quote
  #3 (permalink)  
Old 09-25-2003
Billy
 
Posts: n/a
Default Re: PHP & SESSION problems

I found the problem.

- Sessions are written to a file on the server
- The default path is /tmp/

Sessions were not being written to the folder. Fixed folder permissions
etc... and it works now.

"frankly" <frank@dev.null> wrote in message
news:bkv4c3$b9u$2@hermes.castel.nl...
> Billy wrote:
>
> > I've never had problems with SESSIONS until now. It seems that I can't

set
> > SESSIONS at all.
> >
> > Here's my test scripts:
> >
> > I'm trying to set a session in ANY way in this script. I redirect to

another
> > script which should show ANY sessions, but nothing is in either
> > $HTTP_SESSION_VARS or $_SESSION.
> >
> > What gives?
> >
> > <?
> >
> > session_start();
> >

> "short_open_tag = Off" in your php.ini? :P
>
> --
> <nospam>
> Email: frank.at.fake.eu.org
> </nospam>
> ==========================
>



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:20 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0