Jump to content

Recommended Posts

I got  a strange problem.

I have membership site, where user can log in...view profile of other members, add them to friends list etc.

When i log in...the session is set say $_SESSION("session_userid")

 

And i can view the profile of user using http://www.username.mysite.com

when i log in it takes me to http://www.mysite.com

from there i want to view profile of username2 and i type http://www.username2.mysite.com

but when i reach there my session gets destroyed...

what is the problem?

i havent destroyed session anywhere.......session shudnot be destroyed unless i redirect user to logout.php

 

Please help me guys

 

Link to comment
https://forums.phpfreaks.com/topic/87521-solved-my-session-gets-destroyed/
Share on other sites

Are you using $_SESSION['session_userid'] rather than your $_SESSION("session_userid") ?

 

Also, do all pages have session_start() at the top?

 

Thanks, yeah i have done $_SESSION['session_userid'] in all pages

and session_start() is done in all pages as well

 

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.