...

View Full Version : question about sessions?



amir
07-09-2005, 06:25 AM
hi all.
i m using two web browsers
1) Internet Explorer

and

2) Mozilla Fire Fox

I m using sessions in my site, its working fine to me but there is one prob in that when i enter Username and Password and login in to site by Mozilla, and copy the URL and Paste it in Internet Explorer, an error msg comes that PLZ come through proper login. it means that sessions are working fine but when i Press CTRL+N and instantiate a new instance of Fire Fox and then paste that URL in this browser, then session does not work.
PLZ tell me the solution of this prob.
Any sujestions would be highly appreciated.

Regards,
Aamir.

Velox Letum
07-09-2005, 06:39 AM
Okay...I didn't quite catch that...could you possibly tell us what you are trying to accomplish?

amir
07-09-2005, 07:49 AM
i m using two web browsers internet explorer and fire fox. i wanna ask that when i enter my site by authenticating my login in fire fox, and i copy what is in the address bar of fire fox and paste it in Internet explorer, then an error msg comes that "Please come through proper login". i have implemented it by sessions and a check of JavaScript. this works fine for me but my prob is that when i using fire fox, press CTRL+T to open a new fire fox window and paste that url from ist window to 2nd one, then no msg comes and i wanna stop this.




############### Login File#####################
if( $id != ' ' && $status == '1' && $level == '1' )
{
$_SESSION['userid'] = $id;
echo "<meta http-equiv='refresh' content='0;URL=home.php'>"; }
elseif( $id != ' ' && $status == '0' && $level == '2' ) // Client Level is 2
{
?>
<script language="JavaScript">alert('Your account is wrong.');
window.location="index.php";
</script>
<?
}
#################################################

####################Header File######################

if( $id == ' ' )
{
echo "<script language='JavaScript'>
alert('plz come through proper login');window.location='index.php'</script>";
}

#################################################




Regards,
Aamir.

Kurashu
07-09-2005, 10:04 AM
Ok. I picked up the important words (Firefox, IE, sessions, etc.), and I THINK I know what you mean.

You login in with Firefox. That works and it sets a session. Then you try to just go through the page in IE and your error message comes up, like it is supposed to.

BUT when you create a new tab in Firefox and enter the URL it doesn't authenticate and just takes you to the page. And you want to stop this.

You can't. Simple as that.

Nightfire
07-09-2005, 11:46 AM
Yep, can't stop it. It's the same browser. It's how it's meant to work. They have to have been logged in properly to be able to get to that screen anyway, if you've coded right. So why not allow them to have tabs open?

delinear
07-09-2005, 12:23 PM
Yep, can't stop it. It's the same browser. It's how it's meant to work. They have to have been logged in properly to be able to get to that screen anyway, if you've coded right. So why not allow them to have tabs open?
I think what he's saying is he wants them to be able to have tabs open and for the sessions to pass between the tabs, so a user logs in, opens a new tab and is already logged in in that new tab, but it's not happening, he has to log in separately for every single tab he opens.

Unfortunately, as Kurashu said, it just doesn't work that way in FF. It does work that way in IE, of course - file/new/window or ctrl-n will open a new browser and any active sessions from the previous browser will be carried over to the new browser so the user will already be logged in, but FF simply doesn't work the same way.

I think security is the reason given for this although I'm not sure what the actual security implications are. As you said, if the user has already logged into the site through one tab then it seems strange not to have them automatically logged in when they open new tabs and the existing login is still active :cool:

joeframbach
07-09-2005, 05:09 PM
hmm.
i am using firefox. when i read this thread, i right-clicked on the "reply" button, and opened it in a new tab. and here i am, still logged in and right where i left off. do these forums use sessions?

BaDgEr
07-09-2005, 06:00 PM
hmm.
i am using firefox. when i read this thread, i right-clicked on the "reply" button, and opened it in a new tab. and here i am, still logged in and right where i left off. do these forums use sessions?

Cookies :)

Kurashu
07-09-2005, 09:31 PM
Only if you tell them to.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum