473,782 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help on Session module please

rajiv07
141 New Member
I have some problem in session loading

[PHP]use CGI;
use CGI::Session;
use CGI::Cookie;

my $session = "" ;

my $sid = "" ;

$sid = _CheckCookie1() ;

if($sid eq "")
{
$session = new CGI::Session("d river:File", $cgi, {Directory=>'/tmp'});

my $server = $ENV{'HTTP_HOST '};

my $path = "/";

$sid = $session->id();

print "Set-Cookie: CGISESSID\=$sid ; path\=$path; domain\=$server \n" ;
}
else
{
$session = new CGI::Session(un def, $sid, {Directory=>'/tmp'});
}


sub _CheckCookie1
{
use CGI::Cookie;

my $q = new CGI ;

my $c = new CGI::Cookie;

my %cookies;

my $cString = "" ;

%cookies = fetch CGI::Cookie;

$x = $cookies{CGISES SID};

my @temp = split(/CGISESSID\=/,$x);

my @temp1 = split(/\;/,$temp[1]);

my $cUser1 = $temp1[0];

return $cUser1 ;
}[/PHP]

when i execute this code it gives the following error

Can't locate object method "generate_i d" via package "CGI::Session:: ID::" (perhaps you forgot to load "CGI::Session:: ID::"?) at C:/Perl/lib/CGI/Session.pm line 74.


Please help me.

Thank in advance.
Sep 10 '07 #1
4 3767
numberwhun
3,509 Recognized Expert Moderator Specialist
I have some problem in session loading

Expand|Select|Wrap|Line Numbers
  1. use CGI;
  2. use CGI::Session;
  3. use CGI::Cookie;
  4.  
  5. my $session = "" ;
  6.  
  7. my $sid = "" ;
  8.  
  9. $sid = _CheckCookie1();
  10.  
  11. if($sid eq "")
  12. {
  13.  $session = new CGI::Session("driver:File", $cgi, {Directory=>'/tmp'});
  14.  
  15.  my $server = $ENV{'HTTP_HOST'};
  16.  
  17.  my $path = "/";
  18.  
  19.  $sid = $session->id();
  20.  
  21.  print "Set-Cookie: CGISESSID\=$sid; path\=$path; domain\=$server\n" ;
  22. }
  23. else
  24. {
  25.  $session = new CGI::Session(undef, $sid, {Directory=>'/tmp'});
  26. }
  27.  
  28.  
  29. sub _CheckCookie1
  30. {
  31.  use CGI::Cookie;
  32.  
  33.  my $q = new CGI ;
  34.  
  35.  my $c = new CGI::Cookie;
  36.  
  37.  my %cookies;
  38.  
  39.  my $cString = "" ;
  40.  
  41.  %cookies = fetch CGI::Cookie;
  42.  
  43.  $x = $cookies{CGISESSID};
  44.  
  45.  my @temp = split(/CGISESSID\=/,$x);
  46.  
  47.  my @temp1 = split(/\;/,$temp[1]);
  48.  
  49.  my $cUser1 = $temp1[0];
  50.  
  51.  return $cUser1 ;
  52. }
when i execute this code it gives the following error

Can't locate object method "generate_i d" via package "CGI::Session:: ID::" (perhaps you forgot to load "CGI::Session:: ID::"?) at C:/Perl/lib/CGI/Session.pm line 74.


Please help me.

Thank in advance.
Just a shot in the dark, but have you tried loading the module CGI::Session::I D from CPAN and re-running?

Regards,

Jeff
Sep 10 '07 #2
rajiv07
141 New Member
Thanks for your reply

I have load CGI::Session::I D::md5 (- default CGI::Session ID generator) module and re-run also it giving the same error.

Is any idea please.
Sep 11 '07 #3
KevinADC
4,059 Recognized Expert Specialist
The error message is coming from the Session.pm module. You should not have to add any code to your main script to get that to work. Do you have Digest::MD5 installed?
Sep 11 '07 #4
avarix
1 New Member
CGI::Session dynamically loads all drivers.
Try to check which drivers are used to store session state (CGI::Session:: Driver::memcach ed_mysql for example).
CGI::Session is derived from CGI::Session::E rrorHandler, so you can get a real error message with errstr().
Mar 28 '08 #5

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

Similar topics

2
4585
by: Rea | last post by:
Hi! I've searched high and low for this on the net but stil haven't found an answer. I'm trying to install both postnuke and xoops on a win2k server with php 4.3.3. and mysql installed. Both applications are loading terribly slow. When the page finally has been rendered I got the following error:
3
3541
by: PM | last post by:
I'm trying to make a kind of search history containing the 3 last searched words. So I'm using 3 Session Variables: Word1 / Word2 / Word3. In order to get this history working, I need to put the last searched word in the following Variable. Ex.: Session("Word3") = Session("Word2") Session("Word2") = Session("Word1")
2
8571
by: moklet | last post by:
i've been trying to create an insert/update trigger on v_$session but with no success. following is my code: 1 create or replace trigger trg_module 2 instead of insert or update on t_$session 3 begin 4 delete from t_modes; 5* end; SQL> /
3
4545
by: WilsonSmith | last post by:
When I use a session variable in a module, it says "Name session is not declared". Is it not possible to use session variable in module? Wilson
10
2408
by: thomson | last post by:
Hi, i create a session variable in C# as follows Session , but iam not able to access the variable in VB.net like intmode=Session("var"); Why is that ? Regards
9
3193
by: Randy | last post by:
Hello, I'm having a strange problem. I've got a .NET web app which uses Session variables. Sometime, not all the time, they get cross threaded...that is...one user will have another user's Session variable(s) data assigned to them. I can't figure out why. I've read that other people are having this problem too but I haven't found a resolution yet. Can someone please tell me how I might go about fixing this? Thanks
9
4169
by: Sullivan WxPyQtKinter | last post by:
I do not want to use Cookies in my site since not all web browser support it well and sometimes people close cookie functioning for security reasons. I tried to add hidden field with a sessionID in every python CGI script generated web pages, so everytime my client POST a request, the server will retrieve the sessionID and decide if it is in the same session. However, since python cgi do not have a function for redirecting to a page, I...
6
16037
by: KevinGravelle | last post by:
What is wrong with this picture? I'm trying to set my shopping cart text on my home page using the following function that is executed when the class is constructed: protected string fnGetShoppingCartText() { if (Session != null) { ArrayList cart = (ArrayList)Session;
4
2515
by: Cirene | last post by:
In my web.config I added <pages enableSessionState="true">. In each of my pages I also added EnableSessionState="True" to the Page declaration. (I didn't think this was necessary, but...) Any reason why even though I did this I keep getting this error.... Server Error in '/abc' Application.
0
9641
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10313
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...
1
10080
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
9944
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...
1
7494
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
6735
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
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 we have to send another system
2
3643
muto222
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.