Page 1 of 1

Session Not Starting

Posted: Wed Mar 19, 2003 4:09 pm
by justravis
I created a 'nologin' page to my site for those users that don't want to bother with logging in. It's a temporary substitute for IP authentication.

For one subscriber, the session will only start from one computer on campus. It has Windows XP & IE6. The computers that cannot start a session have Windows XP or another older version of Windows and IE & NS 6 or older. Is there a setting somewhere that would disrupt the session starting process??? Since I'm not using cookies, cookie settings are irrelevent right?

Since only 1 subscriber is complaining, I'm assuming it is a isolated incident. The nologin page seems pretty simplistic, but do you see any errors????

Code: Select all

<?php

#PG ENABLES USERS TO BYPASS LOGIN

if($_GET[user])
{
        include 'functions.phps';

        session_start();

        $_SESSION['user']=$_GET[user];

        #userip($_SESSION['user']);

        $nologin=$_SESSION['user'];
}

header("Location: http://website.com?nologin=$nologin");

?>

Re: Session Not Starting

Posted: Wed Mar 19, 2003 4:24 pm
by lazy_yogi
change this
if($_GET[user])
and
$_SESSION['user']=$_GET[user];
to
if($_GET['user'])
and
$_SESSION['user']=$_GET['user'];

Related problem

Posted: Wed Mar 19, 2003 6:24 pm
by opedroso
Assume the string "user" is actually coming from an array, so I end up having $varName="user" and then accessing the _get like this:

[quote] $_SESSION['user']=$_GET[$varName]; [/quote]

In this case, do I have to add ticks around the string "user" before accessing it? (Something like forcing $varName="'user'", or $varName equal quote tick user tick quote)

Thanks

Posted: Sun Mar 23, 2003 3:09 am
by justravis
I received 2 e-mails from the user.

First, he told me the quote changes did not make a difference. (Thanx anyway.)

His next e-mail said this:
OK, I've figured out what the trouble is. I finally thought to check my
browser's "privacy report," which logs whether cookies are accepted or
blocked, and found that cookies from your site were being blocked (even
though my Internet Explorer security level is set to "low". This
appears not to be a problem on your end after all, although I'm
surprised that my browser refused cookies from your site.
I'm just using sessions. Not setting any cookies. Why are these browser settings relevent? Is there a workaround?

Posted: Sun Mar 23, 2003 9:26 am
by hedge
Are you sure you aren't using cookies. By default PHP passes the session id along via a cookie. It should also fall back to appending the sessionid to the url if the cookie can't be set (if you have enable-trans-sid turned on).