Jump to content

Pass sign in info to new window


cfemocha

Recommended Posts

I have a page that needs user to log in to see the contents. Inside the content there is a link which will open up in a new window. What do I need to do so the new window will recognize the user has already signed in? And how do I pass member datas pulled out from the database to the new window without using the get method (i.e. showing it in the url) ?
Link to comment
https://forums.phpfreaks.com/topic/23079-pass-sign-in-info-to-new-window/
Share on other sites

You could either serialize the session and pass it to the new window in a querystring, or you could use javascript and this.opener to get the data (which would be stored in a hidden or something similar).

You could also keep track of the session information in the database.
[quote author=brown2005 link=topic=110587.msg447229#msg447229 date=1160063360]
use sessions or cookies..
[/quote]

Im using sessions on the signin page (i.e. $userid = $_SESSION['user_id']; )
and my link is like <a href="newwindow.html">new window</a>

but $_SESSION['user_id'] does not seem to have been passed to the new window. Am I missing something here?

Any help is appreciated.
Thank you.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.