473,471 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Session is not working on live server

2 New Member
Hi,
I trying to store a image path on session object.It is working fine on development server but not working on live.How to overcome this problem??
Aug 9 '07 #1
3 1501
jhardman
3,406 Recognized Expert Specialist
can you get any session values saved? Post your code.

Jared
Aug 9 '07 #2
diya123
2 New Member
Hi
these the two files I am using

Uploadwin.asp
Expand|Select|Wrap|Line Numbers
  1. <!-- #include file="uploader.asp" -->
  2. <%
  3.  
  4. Dim uploadsDirVar
  5.  
  6. uploadsDirVar = server.MapPath("../images/news") 
  7.  
  8.  
  9. function SaveFiles
  10. Dim Upload, fileName, fileSize, ks, i, fileKey
  11.  
  12. Set Upload = New FreeASPUpload
  13. Upload.Save(uploadsDirVar)
  14.  
  15. ' If something fails inside the script, but the exception is handled
  16.  
  17. If Err.Number<>0 then Exit function
  18. SaveFiles = ""
  19. ks = Upload.UploadedFiles.keys
  20.  
  21. if (UBound(ks) <> -1) then
  22. 'SaveFiles = "<B>Files uploaded:</B> "
  23. for each fileKey in Upload.UploadedFiles.keys
  24.  
  25. SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) "
  26. SaveFiles1 = SaveFiles1 & Upload.UploadedFiles(fileKey).FileName & " "
  27.  
  28. next
  29.  
  30.   else
  31.      SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system."
  32.  
  33. end if
  34.  
  35. Session("newsI")=SaveFiles1
  36. Session("newsImgs")=SaveFiles1
  37. 'Response.write "<br><br><br><br><br>"&Session("newsI")
  38. end function
  39.  
  40.  
  41. if Request.ServerVariables("REQUEST_METHOD") = "POST" then
  42.    SaveFiles()
  43.    Response.Redirect "Addimage.asp"
  44. end if
  45. %>
  46.  

addimages.asp

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Session.LCID=2057
  3.  
  4.  Dim arrMonthName(12)
  5.  
  6.  dim emptystring
  7.  
  8. arrMonthName(0) = "Jan"
  9. arrMonthName(1) = "Feb"
  10. arrMonthName(2) = "Mar"
  11. arrMonthName(3) = "Apr"
  12. arrMonthName(4) = "May"
  13. arrMonthName(5) = "Jun"
  14. arrMonthName(6) = "Jul"
  15. arrMonthName(7) = "Aug"
  16. arrMonthName(8) = "Sep"
  17. arrMonthName(9) = "Oct"
  18. arrMonthName(10)= "Nov"
  19. arrMonthName(11)= "Dec"
  20.  
  21.  
  22.  Dates=Request("dates")
  23.  months=(Request("months"))
  24.  years=(Request("years"))
  25.  title=(Request("title"))
  26.  story=(Request("story"))
  27.  bimage=Session("newsI") 
  28.  
  29.  
  30.  dDate= months& "/" & Dates& "/" & years
  31.  
  32.  emptystring=""
  33.  
  34. if dDate<>"" and title<>"" and story<>"" and bimage<>""  then 
  35.  
  36.  
  37. Dim strDBPath,cnnDB ' path to Access database (*.mdb) file
  38.  
  39.  
  40. Set cnnDB = Server.CreateObject("ADODB.Connection")
  41.  
  42.  
  43. strDBPath = Server.MapPath("..\Database\data.mdb")
  44.  
  45. cnnDB.Open "Data Source=" & strDBPath & ";Provider=Microsoft.Jet.OLEDB.4.0;"
  46.  
  47. strSQL = "INSERT INTO news_t(dates, title, bimage, news) VALUES ('"& dDate &"','"& title &"','"& bimage &"','"& story &"')"
  48.  
  49. cnnDB.Execute(strSQL)
  50.  
  51. Session("newsI")=""
  52. Response.redirect("addresponse.asp")
  53.  
  54. else
  55.  
  56. emptystring="All fields are Mandatory"
  57. end if
  58.  %>
  59.  

on this second page addimages.asp, on development server it displays the bimage but on live site it is not displaying....

Can you advice me pls?
Aug 12 '07 #3
jhardman
3,406 Recognized Expert Specialist
this is a bit of a puzzler. try this code in the top of the file, right before you set the lcid:
Expand|Select|Wrap|Line Numbers
  1. for each x in session
  2.    response.write x & ": " & session(x) & "<br>" & vbNewLine
  3. next
This should just list everything in the session variables. Let me know if it gives you anything at all. I was thinking you could also find the server's value for the session ID, but I can't find it. That's the next thing I would try, check to see what the session ID is listed on the two pages, see if it changes.

Jared
Aug 13 '07 #4

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

Similar topics

8
by: ndsoumah | last post by:
hello guys I'm trying to get access to variables I put in a session variable from another page and it fails... here's the exact situation main file page1.php
3
by: headware | last post by:
I have an issue that I've been encountering in an ASP application I'm working on. Most of the application is written in ASP, but there is one page written in ASP.NET. The ASP.NET page needs to have...
4
by: John Q. Smith | last post by:
I'm trying to find out some of the details behind OOP state management with SQL Server. For instance - how long does the session object live on any server? Is it created and destoyed with each...
8
by: Anthony P. Mancini | last post by:
I'm working on a proof of concept that will ultimately be deployed on a load balancer. For the sake of a preliminary demonstration I created a C# object and marked it's attributes as Public...
0
by: | last post by:
I recently wrote two asp.net based web apps based around the Enterprise Library application blocks and generated code and stored procedurescode in myGeneratation. One works fine but the other is...
1
by: Pupkin | last post by:
Hi, I have a dev site and a live site. On the dev site I have code in every page that checks for a querystring value and stores it in a session so if the user submits a contact form at any time...
1
by: =?Utf-8?B?U00=?= | last post by:
Background We migrated our Asp.net 1.1 application to Asp.net 2.0 ( just migration ) .. It was working fine in local developer machine and one of our development testing server. When we moved...
3
by: RSH | last post by:
Hi, I have a situation where I have created an object that contains fields,properties and functions. After creating the object I attempted to assign it to a session variable so i could retrieve...
4
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, I am getting the following error intermittently: "Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when Session...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
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...
0
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...
1
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...
0
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...
0
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.