session_start(); and "session already started" madness

This is a discussion on session_start(); and "session already started" madness within the PHP General forums, part of the PHP Programming Forums category; Hello... I have an application that used to work but I'm having problems after an upgrade to 4.3....


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-16-2003
steve
 
Posts: n/a
Default session_start(); and "session already started" madness

Hello...

I have an application that used to work but I'm having problems after
an upgrade to 4.3.3 on iis (w/ the isapi dll). I used to include a
page called login.php in every page which began w/ a session_start();
as per the "page1, page2" tutorial on the php site:

http://us2.php.net/function.session-start

As the site says I will, I'm getting errors that the session is
already started... but that's exactly what they STILL tell you you
should be doing in the tutorial. very frustrating.

Here's a very simplified version of how my site works

index.php:

--
session_start();
session_register("logged_in");
session_register("user_id");

$logged_in="some_random_stuff";
$user_id=$auth_user;
--

login.php (included in every page):
---
session_start();
if(!isset($logged_in) || $logged_in != "some_random_stuff") {
header("someplace_else.php");
exit;}
---

I've had to take the session_start(); message out of the login.php or
I get errors. Every once and awhile (it's very hit and miss) people
are now loosing their $logged_in session variable and I'm thinking
it's because I'm not keeping the session going on every page.

What's the right way to do this?

thanks,
p

ps I'm basically using all the default php.ini setting w/ the
exception of register globals being on, and session cache limiter set
to blank.
Reply With Quote
Reply


Thread Tools
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

vB 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 02:58 PM.


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