473,811 Members | 3,579 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Session is lost when using ( or not using) www in the URL

rizwan6feb
108 New Member
Hi everyone, I am having a problem in with PHP sessions. Most of the URLs i haved used in PHP are in the form http://www.example.com i.e include www in the url. But if someone types http://example.com in the address bar of the browser and logs in, i redirect them to http://www.example.com/account.php their session is lost. How can i resolve this
Aug 7 '08 #1
7 1496
nathj
938 Recognized Expert Contributor
Can we see the code? My first guess, that there is a missing session_start() could be the thing to check but there may be something else going on.

Post the code - remember to use code tags.

Cheers
nathj
Aug 7 '08 #2
pbmods
5,821 Recognized Expert Expert
Heya, rizwan6feb.

My first guess is that your session cookie is restricted to the www subdomain.

Look at your php.ini file's session cookie settings (http://php.net/manual/en/session.con....cookie_domain) and see if you need to adjust it (probably from '' to '.myweb.com').
Aug 7 '08 #3
rizwan6feb
108 New Member
Heya, rizwan6feb.

My first guess is that your session cookie is restricted to the www subdomain.

Look at your php.ini file's session cookie settings (http://php.net/manual/en/session.con....cookie_domain) and see if you need to adjust it (probably from '' to '.myweb.com').

Thanks, sorry for late response

session.cookie_ domain variable is set to 'no value'
Aug 19 '08 #4
pbmods
5,821 Recognized Expert Expert
Try setting it to '.example.com' (replace "example.co m" with your domain). Then restart Apache, clear your cookies and try again.
Aug 19 '08 #5
rizwan6feb
108 New Member
But i am using more than 1 domains
Aug 20 '08 #6
pbmods
5,821 Recognized Expert Expert
But i am using more than 1 domains
More than one domain pointing to the same site, or are there multiple sites on your box?
Aug 20 '08 #7
rizwan6feb
108 New Member
More than one domains on a single box
Aug 22 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2006
by: | last post by:
What could the likely cause of a session value being lost when one navigates to another page and attempts to write that session out: Page 1 session("u_name") = oRS.fields("u_name") Navigate to Page 2 Response.write Session("u_name")
6
13015
by: Tony G. | last post by:
Hi there, I have an APS 3 application, running on a Windows 2003 Web edition server - it is a very busy website, and when users are click on certain links (membership info), a new window i opened via javascript. This new window is on the SAME website as where the user is located, but just opened in HTTPS (secure) mode - the user can now examine memberhip terms and continue to buy membership.
2
1312
by: Bill L | last post by:
Hi guys, Got problem with session when I install new DLL file or replace DLL file in /bin folder, is there anyway I can stop this happened ? I don't run two version of side by side and seems the application has to restart if there is new DLL installed by MS document. I am not sure I understand the doc right or not. thanks Bill
2
3767
by: David Berman | last post by:
It seems that my site is losing session information when using Server.Transfer. I have a page called PictureGallery.aspx. It takes an argument which is an index id, so it would look like PictureGallery.aspx?id=30 to display gallery 30. In this way I have a database driven picture gallery. To improve indexing, I put code in Global.asax to allow me to get to the same page with a url like this: Pictures_30.aspx. There is no...
2
1235
by: Jack | last post by:
To whom may concern: 1. Web.config <authentication mode="Forms"> <forms name=".Portal" protection="All" timeout="3600" loginUrl="Login.aspx" /> </authentication> 2. The "Login.aspx" is in root of a virtual path, but I'm visiting a sub path, and now session lost, so program will redirect to login page,
1
1006
by: RonL | last post by:
I was reading that Session State is lost when the application domain is re-created (e.g. when the web app code is updated or the config is changed). Does this mean that data that is stored in Session variables is lost? I'm using Mode= "InProc". Ron
2
1690
by: DigitalFusion | last post by:
Hello All, I have an app on an intranet which uses the response.contenttype in ASP to create a word doc. The issue I am having is that when this doc is generated and opened, the session is lost. We have tried everything up to this point, setting timeout in IIS, refresh scripts, etc, until we realized it has something to to do with the Word document. I have spent a LOT of time trying to figure this out, or find an answer online. I...
1
1452
by: vikram.lakhotia | last post by:
Hi Have you tried deleting a directory in Asp.Net. Here is an article discussing the problem deleting a Directory in Asp.Net http://www.vikramlakhotia.com/Deleting_Directory_in_ASPnet_20.aspx Hope this helps Thanks Vikram
16
7896
by: Jeigh | last post by:
Hello, I've been testing my site and have ran into a problem, I have a page in which members can make a portfolio, giving other members the ability to rate it, recommend it, favourite it etc. All my pages the pages have the same structure, all include the same files such as session.php etc. The session works fine until they submit a form, when the form is submitted it logs them out, and as guests can not use these functions it shows them a...
8
2319
by: NilMS | last post by:
Hi, I have created a test Web Application Project. Default.aspx just has a button. Page_Load has following code: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.