Jump to content

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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.