Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Thanked 0 Times in 0 Posts

    losing session object when using window.location.href

    Hiya, does the session reset if I use javascript window.location.href?

    I've written a login page which validates a user logging in, I want to then redirect them to another location but keeping the session obejct/variables, using javascript window.location.href seems to reset the session, I'd prefer not to use header("Location: as the page has already loaded, isn't there a function similar to refirect or sth in php?

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Thanked 48 Times in 48 Posts
    From what I remember, the only way to do it would be by doing something like

    window.location.href='page.php?<?php echo session_name().'='.session_id();?>'
    Last edited by Nightfire; 01-04-2004 at 08:43 PM.


    Posting Permissions

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