Jump to content

passing the whole session to new window.


kucing

Recommended Posts

when i try to open a new window using javascript window.open function. sometime the new window opens with new session.

 

So I need some help here to pass the whole session to new window using the session_id function.

 

Any work around?

 

Thanks

Link to comment
Share on other sites

Doesn't just using session_start() do this?

 

If not you could set a cookie storing the session id, grab that value and start a session based on that value however this seems superflous as this is the usual way sessions should work anyway! I guess it's a worth a try though if nothing else will work.

Link to comment
Share on other sites

This method is only as insecure as using just session_start() because sessions by default use a cookie to store the session id. It is true however that if a malicious user got hold of your session id, they could steal session.

 

I recommend using session_regenerate_id() when the user logs in/out or has any change in  authorisation level. Infact, use it as often as possible. This function creates a new session id so if a hacker did get hold of your id it would be useless pretty much instantly.

 

There are some good tutorials on the internet about session security in PHP so I would suggest given them a read for a more indepth discussion about this.

Link to comment
Share on other sites

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.