Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Location
    Pakistan
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    question about sessions?

    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.
    God helps those who help others.

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay...I didn't quite catch that...could you possibly tell us what you are trying to accomplish?
    "$question = ( to() ) ? be() : ~be();"

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Location
    Pakistan
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    i try

    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.

    PHP Code:

    ############### 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.
    God helps those who help others.

  • #4
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    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?

  • #6
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Nightfire
    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

  • #7
    Regular Coder
    Join Date
    Dec 2002
    Location
    a bit west of pittsburgh
    Posts
    236
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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?

  • #8
    New Coder
    Join Date
    Jul 2005
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by joeframbach
    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

  • #9
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Only if you tell them to.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •