View Full Version : losing session object when using window.location.href

01-04-2004, 08:17 PM
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?

01-04-2004, 08:40 PM
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();?>'